-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
212 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
target/ | ||
target/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ $(SAXON): | target | |
|
||
install: $(SAXON) | target | ||
bundle update | ||
npm --no-color install -g uglify-js | ||
npm --no-color install -g [email protected] | ||
|
||
$(DIRS): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* MIT License | ||
* | ||
* Copyright (c) 2024 Zerocracy | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to who_namem the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
$(function() { | ||
const ctx = document.getElementById('qos'); | ||
new Chart(ctx, { | ||
type: 'line', | ||
data: qos_data, | ||
options: { | ||
responsive: false, | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2024 Zerocracy | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
--- | ||
options: | ||
testing: true | ||
input: | ||
- | ||
when: 2024-05-18T22:22:22.8492Z | ||
what: quality-of-service | ||
average_issue_lifetime: 433.54 | ||
average_pull_lifetime: 3222.98 | ||
average_release_interval: 43432.42 | ||
average_workflow_success_rate: 0.56 | ||
- | ||
when: 2024-04-18T22:22:22.8492Z | ||
what: quality-of-service | ||
average_issue_lifetime: 323.54 | ||
average_pull_lifetime: 2092.98 | ||
average_release_interval: 40432.42 | ||
average_workflow_success_rate: 0.67 | ||
expected: | ||
- /fb[count(f)=2] | ||
- /fb/f[n_average_issue_lifetime] | ||
- /fb/f[n_average_release_interval] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
# MIT License | ||
# | ||
# Copyright (c) 2024 Zerocracy | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
require 'fbe/fb' | ||
|
||
facts = Fbe.fb.query('(eq what "quality-of-service")').each.to_a | ||
|
||
facts.sort! { |a, b| a.when <=> b.when } | ||
return if facts.empty? | ||
|
||
start = {} | ||
first = facts.first | ||
first.all_properties.each do |prop| | ||
next unless prop.match?(/^[a-z]+_[a-z]+.*$/) | ||
start[prop] = first[prop][0] | ||
end | ||
|
||
facts.each do |f| | ||
f.all_properties.each do |prop| | ||
next unless prop.match?(/^[a-z]+_[a-z]+.*$/) | ||
v = f[prop][0] | ||
diff = v - start[prop] | ||
diff /= start[prop] unless start[prop].zero? | ||
f.send("n_#{prop}=", diff) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
MIT License | ||
Copyright (c) 2024 Zerocracy | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to who_namem the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
--> | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> | ||
<xsl:template match="/fb" mode="qos"> | ||
<xsl:variable name="fb" select="."/> | ||
<div class="qos"> | ||
<h2> | ||
<xsl:text>Quality of Service</xsl:text> | ||
</h2> | ||
<div style="width: 800px;"> | ||
<canvas id="qos" style="width: 100%"> | ||
<xsl:text> </xsl:text> | ||
</canvas> | ||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
<xsl:text>const qos_data = { labels: [</xsl:text> | ||
<xsl:for-each select="f[what='quality-of-service']/when"> | ||
<xsl:sort select="when" data-type="text" order="ascending"/> | ||
<xsl:if test="position() > 1"> | ||
<xsl:text>, </xsl:text> | ||
</xsl:if> | ||
<xsl:text>'</xsl:text> | ||
<xsl:value-of select="when"/> | ||
<xsl:text>'</xsl:text> | ||
</xsl:for-each> | ||
<xsl:text>],</xsl:text> | ||
<xsl:text>datasets: [</xsl:text> | ||
<xsl:for-each select="tokenize('average_issue_lifetime average_pull_lifetime average_release_interval average_workflow_success_rate', ' ')"> | ||
<xsl:variable name="metric" select="."/> | ||
<xsl:if test="position() > 1"> | ||
<xsl:text>, </xsl:text> | ||
</xsl:if> | ||
<xsl:text>{ label: '</xsl:text> | ||
<xsl:value-of select="."/> | ||
<xsl:text>', data: [</xsl:text> | ||
<xsl:for-each select="$fb/f[what='quality-of-service']"> | ||
<xsl:sort select="when" data-type="text" order="ascending"/> | ||
<xsl:if test="position() > 1"> | ||
<xsl:text>, </xsl:text> | ||
</xsl:if> | ||
<xsl:value-of select="*[name()=concat('n_', $metric)]/text()"/> | ||
</xsl:for-each> | ||
<xsl:text>] }</xsl:text> | ||
</xsl:for-each> | ||
<xsl:text>] };</xsl:text> | ||
</script> | ||
</xsl:template> | ||
</xsl:stylesheet> |