bp2build_metrics.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // Copyright 2021 Google Inc. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package soong_build_bp2build_metrics;
  16. option go_package = "android/soong/ui/metrics/bp2build_metrics_proto";
  17. message Bp2BuildMetrics {
  18. // Total number of Soong modules converted to generated targets
  19. uint64 generatedModuleCount = 1;
  20. // Total number of Soong modules converted to handcrafted targets
  21. uint64 handCraftedModuleCount = 2;
  22. // Total number of unconverted Soong modules
  23. uint64 unconvertedModuleCount = 3;
  24. // Counts of symlinks in synthetic bazel workspace
  25. uint64 workspaceSymlinkCount= 9;
  26. // Counts of mkdir calls during creation of synthetic bazel workspace
  27. uint64 workspaceMkDirCount= 10;
  28. // Counts of generated Bazel targets per Bazel rule class
  29. map<string, uint64> ruleClassCount = 4;
  30. // List of converted modules
  31. repeated string convertedModules = 5;
  32. // Unconverted modules, mapped to the reason the module was not converted.
  33. map<string, UnconvertedReason> unconvertedModules = 11;
  34. // Counts of converted modules by module type.
  35. map<string, uint64> convertedModuleTypeCount = 6;
  36. // Counts of total modules by module type.
  37. map<string, uint64> totalModuleTypeCount = 7;
  38. // List of traced runtime events of bp2build, useful for tracking bp2build
  39. // runtime.
  40. repeated Event events = 8;
  41. }
  42. // Traced runtime event of bp2build.
  43. message Event {
  44. // The event name.
  45. string name = 1;
  46. // The absolute start time of the event
  47. // The number of nanoseconds elapsed since January 1, 1970 UTC.
  48. uint64 start_time = 2;
  49. // The real running time.
  50. // The number of nanoseconds elapsed since start_time.
  51. uint64 real_time = 3;
  52. }
  53. message UnconvertedReason {
  54. // The type of reason that the module could not be converted.
  55. UnconvertedReasonType type = 1;
  56. // Descriptive details describing why the module could not be converted.
  57. // This detail should be kept very short and should be in the context of
  58. // the type. (Otherwise, this would significantly bloat metrics.)
  59. string detail = 2;
  60. }
  61. enum UnconvertedReasonType {
  62. // Bp2build does not know how to convert this specific module for some reason
  63. // not covered by other reason types. The reason detail should explain the
  64. // specific issue.
  65. UNSUPPORTED = 0;
  66. // The module was already defined in a BUILD file available in the source tree.
  67. DEFINED_IN_BUILD_FILE = 1;
  68. // The module was explicitly denylisted by name.
  69. DENYLISTED = 2;
  70. // The module's type has no bp2build implementation.
  71. TYPE_UNSUPPORTED = 3;
  72. // The module has a property not yet supported. The detail field should
  73. // name the unsupported property name.
  74. PROPERTY_UNSUPPORTED = 4;
  75. // The module has an unconverted dependency. The detail should consist of
  76. // the name of the unconverted module.
  77. UNCONVERTED_DEP = 5;
  78. // The module has a source file with the same name as the module itself.
  79. SRC_NAME_COLLISION = 6;
  80. }