pb.proto 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. // order corresponds to `files_couples::index`
  69. repeated int32 files_lines = 9;
  70. }
  71. message UASTChange {
  72. string file_name = 1;
  73. string src_before = 2;
  74. string src_after = 3;
  75. string uast_before = 4;
  76. string uast_after = 5;
  77. }
  78. message UASTChangesSaverResults {
  79. repeated UASTChange changes = 1;
  80. }
  81. message ShotnessRecord {
  82. string type = 1;
  83. string name = 2;
  84. string file = 3;
  85. map<int32, int32> counters = 4;
  86. }
  87. message ShotnessAnalysisResults {
  88. repeated ShotnessRecord records = 1;
  89. }
  90. message FileHistory {
  91. repeated string commits = 1;
  92. }
  93. message FileHistoryResultMessage {
  94. map<string, FileHistory> files = 1;
  95. }
  96. message LineStats {
  97. int32 added = 1;
  98. int32 removed = 2;
  99. int32 changed = 3;
  100. }
  101. message DevDay {
  102. int32 commits = 1;
  103. LineStats stats = 2;
  104. map<string, LineStats> languages = 3;
  105. }
  106. message DayDevs {
  107. map<int32, DevDay> devs = 1;
  108. }
  109. message DevsAnalysisResults {
  110. map<int32, DayDevs> days = 1;
  111. repeated string dev_index = 2;
  112. }
  113. message Sentiment {
  114. float value = 1;
  115. repeated string comments = 2;
  116. repeated string commits = 3;
  117. }
  118. message CommentSentimentResults {
  119. map<int32, Sentiment> sentiment_by_day = 1;
  120. }
  121. message AnalysisResults {
  122. Metadata header = 1;
  123. // the mapped values are dynamic messages which require the second parsing pass.
  124. map<string, bytes> contents = 2;
  125. }