RuntimeProfile.thrift 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Licensed to the Apache Software Foundation (ASF) under one
  2. // or more contributor license agreements. See the NOTICE file
  3. // distributed with this work for additional information
  4. // regarding copyright ownership. The ASF licenses this file
  5. // to you under the Apache License, Version 2.0 (the
  6. // "License"); you may not use this file except in compliance
  7. // with the License. You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing,
  12. // software distributed under the License is distributed on an
  13. // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. // KIND, either express or implied. See the License for the
  15. // specific language governing permissions and limitations
  16. // under the License.
  17. namespace py RuntimeProfile
  18. include "Metrics.thrift"
  19. // Counter data
  20. struct TCounter {
  21. 1: required string name
  22. 2: required Metrics.TUnit unit
  23. 3: required i64 value
  24. }
  25. // Thrift version of RuntimeProfile::EventSequence - list of (label, timestamp) pairs
  26. // which represent an ordered sequence of events.
  27. struct TEventSequence {
  28. 1: required string name
  29. 2: required list<i64> timestamps
  30. 3: required list<string> labels
  31. }
  32. // Struct to contain data sampled at even time intervals (e.g. ram usage every
  33. // N seconds).
  34. // values[0] represents the value when the counter stated (e.g. fragment started)
  35. // values[1] is the value at period_ms (e.g. 500 ms later)
  36. // values[2] is the value at 2 * period_ms (e.g. 1sec since start)
  37. // This can be used to reconstruct a time line for a particular counter.
  38. struct TTimeSeriesCounter {
  39. 1: required string name
  40. 2: required Metrics.TUnit unit
  41. // Period of intervals in ms
  42. 3: required i32 period_ms
  43. // The sampled values.
  44. 4: required list<i64> values
  45. }
  46. // Thrift version of RuntimeProfile::SummaryStatsCounter.
  47. struct TSummaryStatsCounter {
  48. 1: required string name
  49. 2: required Metrics.TUnit unit
  50. 3: required i64 sum
  51. 4: required i64 total_num_values
  52. 5: required i64 min_value
  53. 6: required i64 max_value
  54. }
  55. // A single runtime profile
  56. struct TRuntimeProfileNode {
  57. 1: required string name
  58. 2: required i32 num_children
  59. 3: required list<TCounter> counters
  60. // TODO: should we make metadata a serializable struct? We only use it to
  61. // store the node id right now so this is sufficient.
  62. 4: required i64 metadata
  63. // indicates whether the child will be printed with extra indentation;
  64. // corresponds to indent param of RuntimeProfile::AddChild()
  65. 5: required bool indent
  66. // map of key,value info strings that capture any kind of additional information
  67. // about the profiled object
  68. 6: required map<string, string> info_strings
  69. // Auxilliary structure to capture the info strings display order when printed
  70. 7: required list<string> info_strings_display_order
  71. // map from parent counter name to child counter name
  72. 8: required map<string, set<string>> child_counters_map
  73. // List of event sequences that capture ordered events in a query's lifetime
  74. 9: optional list<TEventSequence> event_sequences
  75. // List of time series counters
  76. 10: optional list<TTimeSeriesCounter> time_series_counters
  77. // List of summary stats counters
  78. 11: optional list<TSummaryStatsCounter> summary_stats_counters
  79. }
  80. // A flattened tree of runtime profiles, obtained by an
  81. // pre-order traversal
  82. struct TRuntimeProfileTree {
  83. 1: required list<TRuntimeProfileNode> nodes
  84. }