pb.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 BurndownAnalysisResults {
  33. // how many days are in each band [burndown_project, burndown_file, burndown_developer]
  34. int32 granularity = 1;
  35. // how frequently we measure the state of each band [burndown_project, burndown_file, burndown_developer]
  36. int32 sampling = 2;
  37. // always exists
  38. BurndownSparseMatrix project = 3;
  39. // this is included if `-burndown-files` was specified
  40. repeated BurndownSparseMatrix files = 4;
  41. // these two are included if `-burndown-people` was specified
  42. repeated BurndownSparseMatrix people = 5;
  43. // rows and cols order correspond to `burndown_developer`
  44. CompressedSparseRowMatrix people_interaction = 6;
  45. }
  46. message CompressedSparseRowMatrix {
  47. int32 number_of_rows = 1;
  48. int32 number_of_columns = 2;
  49. // https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_.28CSR.2C_CRS_or_Yale_format.29
  50. repeated int64 data = 3;
  51. repeated int32 indices = 4;
  52. repeated int64 indptr = 5;
  53. }
  54. message Couples {
  55. // name of each `matrix`'s row and column
  56. repeated string index = 1;
  57. // is always square
  58. CompressedSparseRowMatrix matrix = 2;
  59. }
  60. message TouchedFiles {
  61. repeated int32 files = 1; // values correspond to `file_couples::index`
  62. }
  63. message CouplesAnalysisResults {
  64. Couples file_couples = 6;
  65. Couples people_couples = 7;
  66. // order corresponds to `people_couples::index`
  67. repeated TouchedFiles people_files = 8;
  68. }
  69. message UASTChange {
  70. string file_name = 1;
  71. string src_before = 2;
  72. string src_after = 3;
  73. string uast_before = 4;
  74. string uast_after = 5;
  75. }
  76. message UASTChangesSaverResults {
  77. repeated UASTChange changes = 1;
  78. }
  79. message ShotnessRecord {
  80. string internal_role = 1;
  81. repeated int32 roles = 2;
  82. string name = 3;
  83. string file = 4;
  84. map<int32, int32> counters = 5;
  85. }
  86. message ShotnessAnalysisResults {
  87. repeated ShotnessRecord records = 1;
  88. }
  89. message FileHistory {
  90. repeated string commits = 1;
  91. }
  92. message FileHistoryResultMessage {
  93. map<string, FileHistory> files = 1;
  94. }
  95. message DevDay {
  96. int32 commits = 1;
  97. int32 added = 2;
  98. int32 removed = 3;
  99. int32 changed = 4;
  100. }
  101. message DayDevs {
  102. map<int32, DevDay> devs = 1;
  103. }
  104. message DevsAnalysisResults {
  105. map<int32, DayDevs> days = 1;
  106. repeated string dev_index = 2;
  107. }
  108. message Sentiment {
  109. float value = 1;
  110. repeated string comments = 2;
  111. repeated string commits = 3;
  112. }
  113. message CommentSentimentResults {
  114. map<int32, Sentiment> sentiment_by_day = 1;
  115. }
  116. message AnalysisResults {
  117. Metadata header = 1;
  118. // the mapped values are dynamic messages which require the second parsing pass.
  119. map<string, bytes> contents = 2;
  120. }