pb.proto 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. syntax = "proto3";
  2. message Metadata {
  3. // this format is versioned
  4. int32 version = 1;
  5. // git hash of the revision from which Hercules is built
  6. string hash = 2;
  7. // repository's name
  8. string repository = 3;
  9. // UNIX timestamp of the first analysed commit
  10. int64 begin_unix_time = 4;
  11. // UNIX timestamp of the last analysed commit
  12. int64 end_unix_time = 5;
  13. // number of processed commits
  14. int32 commits = 6;
  15. // duration of the analysis in milliseconds
  16. int64 run_time = 7;
  17. // time taken by each pipeline item in seconds
  18. map<string, double> run_time_per_item = 8;
  19. }
  20. message BurndownSparseMatrixRow {
  21. // the first `len(column)` elements are stored,
  22. // the rest `number_of_columns - len(column)` values are zeros
  23. repeated uint32 columns = 1;
  24. }
  25. message BurndownSparseMatrix {
  26. string name = 1;
  27. int32 number_of_rows = 2;
  28. int32 number_of_columns = 3;
  29. // `len(row)` matches `number_of_rows`
  30. repeated BurndownSparseMatrixRow rows = 4;
  31. }
  32. message FilesOwnership {
  33. // The sum always equals to the total number of lines in the file.
  34. map<int32, int32> value = 1;
  35. }
  36. message BurndownAnalysisResults {
  37. // how many ticks are in each band [burndown_project, burndown_file, burndown_developer]
  38. int32 granularity = 1;
  39. // how frequently we measure the state of each band [burndown_project, burndown_file, burndown_developer]
  40. int32 sampling = 2;
  41. // always exists
  42. BurndownSparseMatrix project = 3;
  43. // this is included if `--burndown-files` was specified
  44. repeated BurndownSparseMatrix files = 4;
  45. // these two are included if `--burndown-people` was specified
  46. repeated BurndownSparseMatrix people = 5;
  47. // rows and cols order correspond to `burndown_developer`
  48. CompressedSparseRowMatrix people_interaction = 6;
  49. // How many lines belong to relevant developers for each file. The order is the same as in `files`.
  50. repeated FilesOwnership files_ownership = 7;
  51. // how long each tick is, as an int64 nanosecond count (Go's time.Duration)
  52. int64 tick_size = 8;
  53. }
  54. message CompressedSparseRowMatrix {
  55. int32 number_of_rows = 1;
  56. int32 number_of_columns = 2;
  57. // https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_.28CSR.2C_CRS_or_Yale_format.29
  58. repeated int64 data = 3;
  59. repeated int32 indices = 4;
  60. repeated int64 indptr = 5;
  61. }
  62. message Couples {
  63. // name of each `matrix`'s row and column
  64. repeated string index = 1;
  65. // is always square
  66. CompressedSparseRowMatrix matrix = 2;
  67. }
  68. message TouchedFiles {
  69. repeated int32 files = 1; // values correspond to `file_couples::index`
  70. }
  71. message CouplesAnalysisResults {
  72. Couples file_couples = 6;
  73. Couples people_couples = 7;
  74. // order corresponds to `people_couples::index`
  75. repeated TouchedFiles people_files = 8;
  76. // order corresponds to `file_couples::index`
  77. repeated int32 files_lines = 9;
  78. }
  79. message UASTChange {
  80. string file_name = 1;
  81. string src_before = 2;
  82. string src_after = 3;
  83. string uast_before = 4;
  84. string uast_after = 5;
  85. }
  86. message UASTChangesSaverResults {
  87. repeated UASTChange changes = 1;
  88. }
  89. message ShotnessRecord {
  90. string type = 1;
  91. string name = 2;
  92. string file = 3;
  93. map<int32, int32> counters = 4;
  94. }
  95. message ShotnessAnalysisResults {
  96. repeated ShotnessRecord records = 1;
  97. }
  98. message FileHistory {
  99. repeated string commits = 1;
  100. map<int32, LineStats> changes_by_developer = 2;
  101. }
  102. message FileHistoryResultMessage {
  103. map<string, FileHistory> files = 1;
  104. }
  105. message LineStats {
  106. int32 added = 1;
  107. int32 removed = 2;
  108. int32 changed = 3;
  109. }
  110. message DevTick {
  111. int32 commits = 1;
  112. LineStats stats = 2;
  113. map<string, LineStats> languages = 3;
  114. }
  115. message TickDevs {
  116. map<int32, DevTick> devs = 1;
  117. }
  118. message DevsAnalysisResults {
  119. map<int32, TickDevs> ticks = 1;
  120. // developer identities, the indexes correspond to TickDevs' keys.
  121. repeated string dev_index = 2;
  122. // how long each tick is, as an int64 nanosecond count (Go's time.Duration)
  123. int64 tick_size = 8;
  124. }
  125. message Sentiment {
  126. float value = 1;
  127. repeated string comments = 2;
  128. repeated string commits = 3;
  129. }
  130. message CommentSentimentResults {
  131. map<int32, Sentiment> sentiment_by_tick = 1;
  132. }
  133. message CommitFile {
  134. string name = 1;
  135. string language = 3;
  136. LineStats stats = 4;
  137. }
  138. message Commit {
  139. string hash = 1;
  140. int64 when_unix_time = 2;
  141. int32 author = 3;
  142. repeated CommitFile files = 4;
  143. }
  144. message CommitsAnalysisResults {
  145. repeated Commit commits = 1;
  146. repeated string author_index = 2;
  147. }
  148. message Typo {
  149. string wrong = 1;
  150. string correct = 2;
  151. string commit = 3;
  152. string file = 4;
  153. int32 line = 5;
  154. }
  155. message TyposDataset {
  156. repeated Typo typos = 1;
  157. }
  158. message ImportsPerTick {
  159. map<int32, int64> counts = 1;
  160. }
  161. message ImportsPerLanguage {
  162. map<string, ImportsPerTick> ticks = 1;
  163. }
  164. message ImportsPerDeveloper {
  165. map<string, ImportsPerLanguage> languages = 1;
  166. }
  167. message ImportsPerDeveloperResults {
  168. repeated ImportsPerDeveloper imports = 1;
  169. repeated string author_index = 2;
  170. // how long each tick is, as an int64 nanosecond count (Go's time.Duration)
  171. int64 tick_size = 3;
  172. }
  173. message AnalysisResults {
  174. Metadata header = 1;
  175. // the mapped values are dynamic messages which require the second parsing pass.
  176. map<string, bytes> contents = 2;
  177. }