index.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (C) 2014 Jakob Borg and other contributors. All rights reserved.
  4. Use of this source code is governed by an MIT-style license that can be
  5. found in the LICENSE file.
  6. -->
  7. <html lang="en">
  8. <head>
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <meta name="description" content="">
  13. <meta name="author" content="">
  14. <link rel="shortcut icon" href="static/assets/img/favicon.png">
  15. <title>Syncthing Usage Reports</title>
  16. <link href="static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  17. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  18. <script type="text/javascript" src="static/bootstrap/js/bootstrap.min.js"></script>
  19. <style type="text/css">
  20. body {
  21. margin: 40px;
  22. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  23. }
  24. tr.main td {
  25. font-weight: bold;
  26. }
  27. tr.child td.first {
  28. padding-left: 2em;
  29. }
  30. </style>
  31. <script type="text/javascript"
  32. src="https://www.google.com/jsapi?autoload={
  33. 'modules':[{
  34. 'name':'visualization',
  35. 'version':'1',
  36. 'packages':['corechart']
  37. }]
  38. }"></script>
  39. <script type="text/javascript">
  40. google.setOnLoadCallback(drawVersionChart);
  41. google.setOnLoadCallback(drawMovementChart);
  42. function drawVersionChart() {
  43. var jsonData = $.ajax({url: "summary.json", dataType:"json", async: false}).responseText;
  44. var rows = JSON.parse(jsonData);
  45. var data = new google.visualization.DataTable();
  46. data.addColumn('date', 'Day');
  47. for (var i = 1; i < rows[0].length; i++){
  48. data.addColumn('number', rows[0][i]);
  49. }
  50. for (var i = 1; i < rows.length; i++){
  51. rows[i][0] = new Date(rows[i][0]);
  52. data.addRow(rows[i]);
  53. };
  54. var options = {
  55. legend: { position: 'bottom', alignment: 'center' },
  56. isStacked: true,
  57. colors: ['rgb(102,194,165)','rgb(252,141,98)','rgb(141,160,203)','rgb(231,138,195)','rgb(166,216,84)','rgb(255,217,47)'],
  58. chartArea: {left: 80, top: 20, width: '1020', height: '300'},
  59. };
  60. var chart = new google.visualization.AreaChart(document.getElementById('versionChart'));
  61. chart.draw(data, options);
  62. }
  63. function drawMovementChart() {
  64. var jsonData = $.ajax({url: "movement.json", dataType:"json", async: false}).responseText;
  65. var rows = JSON.parse(jsonData);
  66. var data = new google.visualization.DataTable();
  67. data.addColumn('date', 'Day');
  68. for (var i = 1; i < rows[0].length; i++){
  69. data.addColumn('number', rows[0][i]);
  70. }
  71. for (var i = 1; i < rows.length; i++){
  72. rows[i][0] = new Date(rows[i][0]);
  73. if (rows[i][1] > 500) {
  74. rows[i][1] = null;
  75. }
  76. if (rows[i][2] < -500) {
  77. rows[i][2] = null;
  78. }
  79. data.addRow(rows[i]);
  80. };
  81. var options = {
  82. legend: { position: 'bottom', alignment: 'center' },
  83. colors: ['rgb(102,194,165)','rgb(252,141,98)','rgb(141,160,203)','rgb(231,138,195)','rgb(166,216,84)','rgb(255,217,47)'],
  84. chartArea: {left: 80, top: 20, width: '1020', height: '300'},
  85. };
  86. var chart = new google.visualization.AreaChart(document.getElementById('movementChart'));
  87. chart.draw(data, options);
  88. }
  89. </script>
  90. </head>
  91. <body>
  92. <div class="container">
  93. <div class="row">
  94. <div class="col-md-12">
  95. <h1>Syncthing Usage Data</h1>
  96. <h4 id="active-users">Active Users per Day and Version</h4>
  97. <p>
  98. This is the total number of unique users with reporting enabled, per day. Area color represents the major version.
  99. </p>
  100. <div class="img-thumbnail" id="versionChart" style="width: 1130px; height: 400px; padding: 10px;"></div>
  101. <h4 id="joining-leaving">Users Joining and Leaving per Day</h4>
  102. <p>
  103. This is the total number of unique users joining and leaving per day. A user is counted as "joined" on first the day their unique ID is seen, and as "left" on the last day the unique ID was seen before a two weeks or longer absence. "Bounced" refers to users who joined and left on the same day.
  104. </p>
  105. <div class="img-thumbnail" id="movementChart" style="width: 1130px; height: 400px; padding: 10px;"></div>
  106. <p class="text-muted">
  107. Reappearance of users cause the "left" data to shrink retroactively.
  108. </p>
  109. <h4 id="metrics">Usage Metrics</h4>
  110. <p>
  111. This is the aggregated usage report data for the last 24 hours. Data based on <b>{{.nodes}}</b> devices that have reported in.
  112. </p>
  113. <table class="table table-striped">
  114. <thead>
  115. <tr>
  116. <th></th><th class="text-right">5%</th><th class="text-right">50%</th><th class="text-right">95%</th><th class="text-right">100%</th>
  117. </tr>
  118. </thead>
  119. <tbody>
  120. {{range .categories}}
  121. <tr>
  122. <td>{{.Descr}}</td>
  123. <td class="text-right">{{index .Values 0 | number .Binary | commatize " "}}{{.Unit}}</td>
  124. <td class="text-right">{{index .Values 1 | number .Binary | commatize " "}}{{.Unit}}</td>
  125. <td class="text-right">{{index .Values 2 | number .Binary | commatize " "}}{{.Unit}}</td>
  126. <td class="text-right">{{index .Values 3 | number .Binary | commatize " "}}{{.Unit}}</td>
  127. </tr>
  128. {{end}}
  129. </tbody>
  130. </table>
  131. </div>
  132. </div>
  133. <div class="row">
  134. <div class="col-md-6">
  135. <table class="table table-striped">
  136. <thead>
  137. <tr>
  138. <th>Version</th><th class="text-right">Devices</th><th class="text-right">Share</th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142. {{range .versions}}
  143. {{if gt .Percentage 0.5}}
  144. <tr class="main">
  145. <td>{{.Key}}</td>
  146. <td class="text-right">{{.Count}}</td>
  147. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  148. </tr>
  149. {{range .Items}}
  150. <tr class="child">
  151. <td class="first">{{.Key}}</td>
  152. <td class="text-right">{{.Count}}</td>
  153. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  154. </tr>
  155. {{end}}
  156. {{end}}
  157. {{end}}
  158. </tbody>
  159. </table>
  160. </div>
  161. <div class="col-md-6">
  162. <table class="table table-striped">
  163. <thead>
  164. <tr>
  165. <th>Platform</th><th class="text-right">Devices</th><th class="text-right">Share</th>
  166. </tr>
  167. </thead>
  168. <tbody>
  169. {{range .platforms}}
  170. <tr class="main">
  171. <td>{{.Key}}</td>
  172. <td class="text-right">{{.Count}}</td>
  173. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  174. </tr>
  175. {{range .Items}}
  176. <tr class="child">
  177. <td class="first">{{.Key}}</td>
  178. <td class="text-right">{{.Count}}</td>
  179. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  180. </tr>
  181. {{end}}
  182. {{end}}
  183. </tbody>
  184. </table>
  185. </div>
  186. </div>
  187. <div class="row">
  188. <div class="col-md-6">
  189. <table class="table table-striped">
  190. <thead>
  191. <tr>
  192. <th>Compiler</th><th class="text-right">Devices</th><th class="text-right">Share</th>
  193. </tr>
  194. </thead>
  195. <tbody>
  196. {{range .compilers}}
  197. <tr class="main">
  198. <td>{{.Key}}</td>
  199. <td class="text-right">{{.Count}}</td>
  200. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  201. </tr>
  202. {{range .Items}}
  203. <tr class="child">
  204. <td class="first">{{.Key}}</td>
  205. <td class="text-right">{{.Count}}</td>
  206. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  207. </tr>
  208. {{end}}
  209. {{end}}
  210. </tbody>
  211. </table>
  212. </div>
  213. <div class="col-md-6">
  214. <table class="table table-striped">
  215. <thead>
  216. <tr>
  217. <th>Builder</th><th class="text-right">Devices</th><th class="text-right">Share</th>
  218. </tr>
  219. </thead>
  220. <tbody>
  221. {{range .builders}}
  222. <tr>
  223. <td>{{.Key}}</td>
  224. <td class="text-right">{{.Count}}</td>
  225. <td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
  226. </tr>
  227. {{end}}
  228. </tbody>
  229. </table>
  230. </div>
  231. </div>
  232. <div class="row">
  233. <div class="col-md-12">
  234. <h4 id="features">Feature Usage</h4>
  235. <p>
  236. The following lists feature usage, as a percentage of the v0.12+ population (<b>{{.v2nodes}}</b> devices).
  237. </p>
  238. <table class="table table-striped">
  239. <thead><tr><th>Feature</th><th colspan="2" class="text-center">Usage</th></tr></thead>
  240. <tbody>
  241. {{range .features}}
  242. <tr>
  243. <td style="width: 30%">{{.Key}}</td>
  244. <td style="width: 10%" class="text-right">{{if ge .Pct 10.0}}{{.Pct | printf "%.0f"}}{{else if ge .Pct 1.0}}{{.Pct | printf "%.01f"}}{{else}}{{.Pct | printf "%.02f"}}{{end}}%</td>
  245. <td style="width: 60%">
  246. <div class="progress-bar" role="progressbar" aria-valuenow="{{.Pct | printf "%.02f"}}" aria-valuemin="0" aria-valuemax="100" style="width: {{.Pct | printf "%.02f"}}%; height:20px"></div>
  247. </td>
  248. </tr>
  249. {{end}}
  250. </tbody>
  251. </table>
  252. </div>
  253. </div>
  254. </div>
  255. </body>
  256. </html>