pb.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 days 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. }
  52. message CompressedSparseRowMatrix {
  53. int32 number_of_rows = 1;
  54. int32 number_of_columns = 2;
  55. // https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_.28CSR.2C_CRS_or_Yale_format.29
  56. repeated int64 data = 3;
  57. repeated int32 indices = 4;
  58. repeated int64 indptr = 5;
  59. }
  60. message Couples {
  61. // name of each `matrix`'s row and column
  62. repeated string index = 1;
  63. // is always square
  64. CompressedSparseRowMatrix matrix = 2;
  65. }
  66. message TouchedFiles {
  67. repeated int32 files = 1; // values correspond to `file_couples::index`
  68. }
  69. message CouplesAnalysisResults {
  70. Couples file_couples = 6;
  71. Couples people_couples = 7;
  72. // order corresponds to `people_couples::index`
  73. repeated TouchedFiles people_files = 8;
  74. // order corresponds to `file_couples::index`
  75. repeated int32 files_lines = 9;
  76. }
  77. message UASTChange {
  78. string file_name = 1;
  79. string src_before = 2;
  80. string src_after = 3;
  81. string uast_before = 4;
  82. string uast_after = 5;
  83. }
  84. message UASTChangesSaverResults {
  85. repeated UASTChange changes = 1;
  86. }
  87. message ShotnessRecord {
  88. string type = 1;
  89. string name = 2;
  90. string file = 3;
  91. map<int32, int32> counters = 4;
  92. }
  93. message ShotnessAnalysisResults {
  94. repeated ShotnessRecord records = 1;
  95. }
  96. message FileHistory {
  97. repeated string commits = 1;
  98. map<int32, LineStats> changes_by_developer = 2;
  99. }
  100. message FileHistoryResultMessage {
  101. map<string, FileHistory> files = 1;
  102. }
  103. message LineStats {
  104. int32 added = 1;
  105. int32 removed = 2;
  106. int32 changed = 3;
  107. }
  108. message DevDay {
  109. int32 commits = 1;
  110. LineStats stats = 2;
  111. map<string, LineStats> languages = 3;
  112. }
  113. message DayDevs {
  114. map<int32, DevDay> devs = 1;
  115. }
  116. message DevsAnalysisResults {
  117. map<int32, DayDevs> days = 1;
  118. repeated string dev_index = 2;
  119. }
  120. message Sentiment {
  121. float value = 1;
  122. repeated string comments = 2;
  123. repeated string commits = 3;
  124. }
  125. message CommentSentimentResults {
  126. map<int32, Sentiment> sentiment_by_day = 1;
  127. }
  128. message AnalysisResults {
  129. Metadata header = 1;
  130. // the mapped values are dynamic messages which require the second parsing pass.
  131. map<string, bytes> contents = 2;
  132. }