graphql 2.4.3 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/graphql/analysis/analyzer.rb +2 -1
- data/lib/graphql/analysis/query_complexity.rb +87 -7
- data/lib/graphql/analysis/visitor.rb +38 -41
- data/lib/graphql/analysis.rb +15 -12
- data/lib/graphql/autoload.rb +38 -0
- data/lib/graphql/backtrace/table.rb +118 -55
- data/lib/graphql/backtrace.rb +1 -19
- data/lib/graphql/current.rb +7 -2
- data/lib/graphql/dashboard/detailed_traces.rb +47 -0
- data/lib/graphql/dashboard/installable.rb +22 -0
- data/lib/graphql/dashboard/limiters.rb +93 -0
- data/lib/graphql/dashboard/operation_store.rb +199 -0
- data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css +6 -0
- data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js +7 -0
- data/lib/graphql/dashboard/statics/charts.min.css +1 -0
- data/lib/graphql/dashboard/statics/dashboard.css +30 -0
- data/lib/graphql/dashboard/statics/dashboard.js +143 -0
- data/lib/graphql/dashboard/statics/header-icon.png +0 -0
- data/lib/graphql/dashboard/statics/icon.png +0 -0
- data/lib/graphql/dashboard/subscriptions.rb +96 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb +45 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb +18 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb +62 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb +18 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb +23 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb +21 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb +69 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb +7 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb +39 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb +32 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb +81 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb +71 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb +41 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb +55 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb +40 -0
- data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +108 -0
- data/lib/graphql/dashboard.rb +158 -0
- data/lib/graphql/dataloader/active_record_association_source.rb +64 -0
- data/lib/graphql/dataloader/active_record_source.rb +26 -0
- data/lib/graphql/dataloader/async_dataloader.rb +21 -9
- data/lib/graphql/dataloader/null_dataloader.rb +1 -1
- data/lib/graphql/dataloader/source.rb +3 -3
- data/lib/graphql/dataloader.rb +43 -14
- data/lib/graphql/dig.rb +2 -1
- data/lib/graphql/execution/interpreter/resolve.rb +3 -3
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +34 -4
- data/lib/graphql/execution/interpreter/runtime.rb +96 -52
- data/lib/graphql/execution/interpreter.rb +16 -7
- data/lib/graphql/execution/multiplex.rb +6 -5
- data/lib/graphql/introspection/directive_location_enum.rb +1 -1
- data/lib/graphql/invalid_name_error.rb +1 -1
- data/lib/graphql/invalid_null_error.rb +19 -16
- data/lib/graphql/language/cache.rb +13 -0
- data/lib/graphql/language/document_from_schema_definition.rb +8 -7
- data/lib/graphql/language/lexer.rb +11 -4
- data/lib/graphql/language/nodes.rb +3 -0
- data/lib/graphql/language/parser.rb +15 -8
- data/lib/graphql/language/printer.rb +8 -8
- data/lib/graphql/language/static_visitor.rb +37 -33
- data/lib/graphql/language/visitor.rb +59 -55
- data/lib/graphql/pagination/connection.rb +1 -1
- data/lib/graphql/query/context/scoped_context.rb +1 -1
- data/lib/graphql/query/context.rb +7 -5
- data/lib/graphql/query/variable_validation_error.rb +1 -1
- data/lib/graphql/query.rb +22 -32
- data/lib/graphql/railtie.rb +7 -0
- data/lib/graphql/schema/addition.rb +1 -1
- data/lib/graphql/schema/always_visible.rb +1 -0
- data/lib/graphql/schema/argument.rb +7 -8
- data/lib/graphql/schema/build_from_definition.rb +99 -53
- data/lib/graphql/schema/directive/flagged.rb +3 -1
- data/lib/graphql/schema/directive.rb +2 -2
- data/lib/graphql/schema/enum.rb +36 -1
- data/lib/graphql/schema/enum_value.rb +1 -1
- data/lib/graphql/schema/field/scope_extension.rb +1 -1
- data/lib/graphql/schema/field.rb +27 -13
- data/lib/graphql/schema/field_extension.rb +1 -1
- data/lib/graphql/schema/has_single_input_argument.rb +3 -1
- data/lib/graphql/schema/input_object.rb +77 -40
- data/lib/graphql/schema/interface.rb +3 -2
- data/lib/graphql/schema/list.rb +1 -1
- data/lib/graphql/schema/loader.rb +1 -1
- data/lib/graphql/schema/member/has_arguments.rb +25 -17
- data/lib/graphql/schema/member/has_dataloader.rb +62 -0
- data/lib/graphql/schema/member/has_deprecation_reason.rb +15 -0
- data/lib/graphql/schema/member/has_directives.rb +4 -4
- data/lib/graphql/schema/member/has_fields.rb +19 -1
- data/lib/graphql/schema/member/has_interfaces.rb +5 -5
- data/lib/graphql/schema/member/has_validators.rb +1 -1
- data/lib/graphql/schema/member/scoped.rb +1 -1
- data/lib/graphql/schema/member/type_system_helpers.rb +1 -1
- data/lib/graphql/schema/member.rb +1 -0
- data/lib/graphql/schema/object.rb +25 -8
- data/lib/graphql/schema/relay_classic_mutation.rb +0 -1
- data/lib/graphql/schema/resolver.rb +12 -10
- data/lib/graphql/schema/subscription.rb +52 -6
- data/lib/graphql/schema/union.rb +1 -1
- data/lib/graphql/schema/validator/required_validator.rb +23 -6
- data/lib/graphql/schema/validator.rb +1 -1
- data/lib/graphql/schema/visibility/migration.rb +1 -0
- data/lib/graphql/schema/visibility/profile.rb +98 -244
- data/lib/graphql/schema/visibility/visit.rb +190 -0
- data/lib/graphql/schema/visibility.rb +178 -38
- data/lib/graphql/schema/warden.rb +18 -5
- data/lib/graphql/schema.rb +266 -54
- data/lib/graphql/static_validation/all_rules.rb +1 -1
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +47 -13
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +79 -17
- data/lib/graphql/static_validation/rules/fields_will_merge_error.rb +10 -2
- data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +25 -0
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +26 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +1 -1
- data/lib/graphql/static_validation/validation_context.rb +1 -0
- data/lib/graphql/static_validation/validator.rb +6 -1
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -1
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +12 -10
- data/lib/graphql/subscriptions/event.rb +12 -1
- data/lib/graphql/subscriptions/serialize.rb +1 -1
- data/lib/graphql/subscriptions.rb +1 -1
- data/lib/graphql/testing/helpers.rb +7 -4
- data/lib/graphql/tracing/active_support_notifications_trace.rb +14 -3
- data/lib/graphql/tracing/active_support_notifications_tracing.rb +1 -1
- data/lib/graphql/tracing/appoptics_trace.rb +9 -1
- data/lib/graphql/tracing/appoptics_tracing.rb +7 -0
- data/lib/graphql/tracing/appsignal_trace.rb +32 -55
- data/lib/graphql/tracing/appsignal_tracing.rb +2 -0
- data/lib/graphql/tracing/call_legacy_tracers.rb +66 -0
- data/lib/graphql/tracing/data_dog_trace.rb +46 -158
- data/lib/graphql/tracing/data_dog_tracing.rb +2 -0
- data/lib/graphql/tracing/detailed_trace/memory_backend.rb +60 -0
- data/lib/graphql/tracing/detailed_trace/redis_backend.rb +72 -0
- data/lib/graphql/tracing/detailed_trace.rb +93 -0
- data/lib/graphql/tracing/legacy_hooks_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_trace.rb +4 -61
- data/lib/graphql/tracing/monitor_trace.rb +283 -0
- data/lib/graphql/tracing/new_relic_trace.rb +47 -54
- data/lib/graphql/tracing/new_relic_tracing.rb +2 -0
- data/lib/graphql/tracing/notifications_trace.rb +182 -34
- data/lib/graphql/tracing/notifications_tracing.rb +2 -0
- data/lib/graphql/tracing/null_trace.rb +9 -0
- data/lib/graphql/tracing/perfetto_trace/trace.proto +141 -0
- data/lib/graphql/tracing/perfetto_trace/trace_pb.rb +33 -0
- data/lib/graphql/tracing/perfetto_trace.rb +734 -0
- data/lib/graphql/tracing/platform_trace.rb +5 -0
- data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +2 -0
- data/lib/graphql/tracing/prometheus_trace.rb +72 -68
- data/lib/graphql/tracing/prometheus_tracing.rb +2 -0
- data/lib/graphql/tracing/scout_trace.rb +32 -55
- data/lib/graphql/tracing/scout_tracing.rb +2 -0
- data/lib/graphql/tracing/sentry_trace.rb +62 -94
- data/lib/graphql/tracing/statsd_trace.rb +33 -41
- data/lib/graphql/tracing/statsd_tracing.rb +2 -0
- data/lib/graphql/tracing/trace.rb +111 -1
- data/lib/graphql/tracing.rb +31 -30
- data/lib/graphql/types/relay/connection_behaviors.rb +3 -3
- data/lib/graphql/types/relay/edge_behaviors.rb +2 -2
- data/lib/graphql/types.rb +18 -11
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +55 -47
- metadata +146 -11
- data/lib/graphql/backtrace/inspect_result.rb +0 -38
- data/lib/graphql/backtrace/trace.rb +0 -93
- data/lib/graphql/backtrace/tracer.rb +0 -80
- data/lib/graphql/schema/null_mask.rb +0 -11
- data/lib/graphql/static_validation/rules/subscription_root_exists.rb +0 -17
@@ -1,45 +1,193 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "graphql/tracing/platform_trace"
|
4
|
-
|
5
3
|
module GraphQL
|
6
4
|
module Tracing
|
7
|
-
# This implementation forwards events to a notification handler
|
8
|
-
# ActiveSupport::Notifications or Dry::Monitor::Notifications)
|
9
|
-
#
|
5
|
+
# This implementation forwards events to a notification handler
|
6
|
+
# (i.e. ActiveSupport::Notifications or Dry::Monitor::Notifications) with a `graphql` suffix.
|
7
|
+
#
|
8
|
+
# @see ActiveSupportNotificationsTrace ActiveSupport::Notifications integration
|
10
9
|
module NotificationsTrace
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
10
|
+
# @api private
|
11
|
+
class Adapter
|
12
|
+
def instrument(keyword, payload, &block)
|
13
|
+
raise "Implement #{self.class}#instrument to measure the block"
|
14
|
+
end
|
15
|
+
|
16
|
+
def start_event(keyword, payload)
|
17
|
+
ev = self.class::Event.new(keyword, payload)
|
18
|
+
ev.start
|
19
|
+
ev
|
20
|
+
end
|
21
|
+
|
22
|
+
class Event
|
23
|
+
def initialize(name, payload)
|
24
|
+
@name = name
|
25
|
+
@payload = payload
|
26
|
+
end
|
27
|
+
|
28
|
+
attr_reader :name, :payload
|
29
|
+
|
30
|
+
def start
|
31
|
+
raise "Implement #{self.class}#start to begin a new event (#{inspect})"
|
32
|
+
end
|
33
|
+
|
34
|
+
def finish
|
35
|
+
raise "Implement #{self.class}#finish to end this event (#{inspect})"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# @api private
|
41
|
+
class DryMonitorAdapter < Adapter
|
42
|
+
def instrument(...)
|
43
|
+
Dry::Monitor.instrument(...)
|
44
|
+
end
|
45
|
+
|
46
|
+
class Event < Adapter::Event
|
47
|
+
def start
|
48
|
+
Dry::Monitor.start(@name, @payload)
|
49
|
+
end
|
50
|
+
|
51
|
+
def finish
|
52
|
+
Dry::Monitor.stop(@name, @payload)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# @api private
|
58
|
+
class ActiveSupportNotificationsAdapter < Adapter
|
59
|
+
def instrument(...)
|
60
|
+
ActiveSupport::Notifications.instrument(...)
|
61
|
+
end
|
62
|
+
|
63
|
+
class Event < Adapter::Event
|
64
|
+
def start
|
65
|
+
@asn_event = ActiveSupport::Notifications.instrumenter.new_event(@name, @payload)
|
66
|
+
@asn_event.start!
|
38
67
|
end
|
39
|
-
|
68
|
+
|
69
|
+
def finish
|
70
|
+
@asn_event.finish!
|
71
|
+
ActiveSupport::Notifications.publish_event(@asn_event)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# @param engine [Class] The notifications engine to use, eg `Dry::Monitor` or `ActiveSupport::Notifications`
|
77
|
+
def initialize(engine:, **rest)
|
78
|
+
adapter = if defined?(Dry::Monitor) && engine == Dry::Monitor
|
79
|
+
DryMonitoringAdapter
|
80
|
+
elsif defined?(ActiveSupport::Notifications) && engine == ActiveSupport::Notifications
|
81
|
+
ActiveSupportNotificationsAdapter
|
82
|
+
else
|
83
|
+
engine
|
84
|
+
end
|
85
|
+
@notifications = adapter.new
|
86
|
+
super
|
87
|
+
end
|
88
|
+
|
89
|
+
def parse(**payload)
|
90
|
+
@notifications.instrument("parse.graphql", payload) do
|
91
|
+
super
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def lex(**payload)
|
96
|
+
@notifications.instrument("lex.graphql", payload) do
|
97
|
+
super
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def validate(**payload)
|
102
|
+
@notifications.instrument("validate.graphql", payload) do
|
103
|
+
super
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def begin_analyze_multiplex(multiplex, analyzers)
|
108
|
+
begin_notifications_event("analyze.graphql", {multiplex: multiplex, analyzers: analyzers})
|
109
|
+
super
|
110
|
+
end
|
111
|
+
|
112
|
+
def end_analyze_multiplex(_multiplex, _analyzers)
|
113
|
+
finish_notifications_event
|
114
|
+
super
|
40
115
|
end
|
41
116
|
|
42
|
-
|
117
|
+
def execute_multiplex(**payload)
|
118
|
+
@notifications.instrument("execute.graphql", payload) do
|
119
|
+
super
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def begin_execute_field(field, object, arguments, query)
|
124
|
+
begin_notifications_event("execute_field.graphql", {field: field, object: object, arguments: arguments, query: query})
|
125
|
+
super
|
126
|
+
end
|
127
|
+
|
128
|
+
def end_execute_field(_field, _object, _arguments, _query, _result)
|
129
|
+
finish_notifications_event
|
130
|
+
super
|
131
|
+
end
|
132
|
+
|
133
|
+
def dataloader_fiber_yield(source)
|
134
|
+
Fiber[PREVIOUS_EV_KEY] = finish_notifications_event
|
135
|
+
super
|
136
|
+
end
|
137
|
+
|
138
|
+
def dataloader_fiber_resume(source)
|
139
|
+
prev_ev = Fiber[PREVIOUS_EV_KEY]
|
140
|
+
begin_notifications_event(prev_ev.name, prev_ev.payload)
|
141
|
+
super
|
142
|
+
end
|
143
|
+
|
144
|
+
def begin_authorized(type, object, context)
|
145
|
+
begin_notifications_event("authorized.graphql", {type: type, object: object, context: context})
|
146
|
+
super
|
147
|
+
end
|
148
|
+
|
149
|
+
def end_authorized(type, object, context, result)
|
150
|
+
finish_notifications_event
|
151
|
+
super
|
152
|
+
end
|
153
|
+
|
154
|
+
def begin_resolve_type(type, object, context)
|
155
|
+
begin_notifications_event("resolve_type.graphql", {type: type, object: object, context: context})
|
156
|
+
super
|
157
|
+
end
|
158
|
+
|
159
|
+
def end_resolve_type(type, object, context, resolved_type)
|
160
|
+
finish_notifications_event
|
161
|
+
super
|
162
|
+
end
|
163
|
+
|
164
|
+
def begin_dataloader_source(source)
|
165
|
+
begin_notifications_event("dataloader_source.graphql", { source: source })
|
166
|
+
super
|
167
|
+
end
|
168
|
+
|
169
|
+
def end_dataloader_source(source)
|
170
|
+
finish_notifications_event
|
171
|
+
super
|
172
|
+
end
|
173
|
+
|
174
|
+
CURRENT_EV_KEY = :__notifications_graphql_trace_event
|
175
|
+
PREVIOUS_EV_KEY = :__notifications_graphql_trace_previous_event
|
176
|
+
|
177
|
+
private
|
178
|
+
|
179
|
+
def begin_notifications_event(name, payload)
|
180
|
+
Fiber[CURRENT_EV_KEY] = @notifications.start_event(name, payload)
|
181
|
+
end
|
182
|
+
|
183
|
+
def finish_notifications_event
|
184
|
+
if ev = Fiber[CURRENT_EV_KEY]
|
185
|
+
ev.finish
|
186
|
+
# Use `false` to prevent grabbing an event from a parent fiber
|
187
|
+
Fiber[CURRENT_EV_KEY] = false
|
188
|
+
ev
|
189
|
+
end
|
190
|
+
end
|
43
191
|
end
|
44
192
|
end
|
45
193
|
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
// This is an abbreviated version of the full Perfetto schema.
|
2
|
+
// Most of them are for OS or Chrome traces and we'll never use them.
|
3
|
+
// Full doc: https://github.com/google/perfetto/tree/main/protos/perfetto
|
4
|
+
//
|
5
|
+
// Build it with
|
6
|
+
// protoc --ruby_out=lib/graphql/tracing/perfetto_trace --proto_path=lib/graphql/tracing/perfetto_trace trace.proto
|
7
|
+
syntax = "proto2";
|
8
|
+
package perfetto_trace.protos;
|
9
|
+
option ruby_package = "GraphQL::Tracing::PerfettoTrace";
|
10
|
+
|
11
|
+
message Trace {
|
12
|
+
repeated TracePacket packet = 1;
|
13
|
+
}
|
14
|
+
|
15
|
+
message TracePacket {
|
16
|
+
optional uint64 timestamp = 8;
|
17
|
+
oneof data {
|
18
|
+
TrackEvent track_event = 11;
|
19
|
+
TrackDescriptor track_descriptor = 60;
|
20
|
+
}
|
21
|
+
oneof optional_trusted_packet_sequence_id {
|
22
|
+
uint32 trusted_packet_sequence_id = 10;
|
23
|
+
}
|
24
|
+
optional InternedData interned_data = 12;
|
25
|
+
optional bool first_packet_on_sequence = 87;
|
26
|
+
optional bool previous_packet_dropped = 42;
|
27
|
+
optional uint32 sequence_flags = 13;
|
28
|
+
}
|
29
|
+
|
30
|
+
message TrackEvent {
|
31
|
+
repeated uint64 category_iids = 3;
|
32
|
+
repeated string categories = 22;
|
33
|
+
oneof name_field {
|
34
|
+
uint64 name_iid = 10;
|
35
|
+
string name = 23;
|
36
|
+
}
|
37
|
+
enum Type {
|
38
|
+
TYPE_UNSPECIFIED = 0;
|
39
|
+
TYPE_SLICE_BEGIN = 1;
|
40
|
+
TYPE_SLICE_END = 2;
|
41
|
+
TYPE_INSTANT = 3;
|
42
|
+
TYPE_COUNTER = 4;
|
43
|
+
}
|
44
|
+
optional Type type = 9;
|
45
|
+
optional uint64 track_uuid = 11;
|
46
|
+
oneof counter_value_field {
|
47
|
+
int64 counter_value = 30;
|
48
|
+
double double_counter_value = 44;
|
49
|
+
}
|
50
|
+
repeated uint64 extra_counter_track_uuids = 31;
|
51
|
+
repeated int64 extra_counter_values = 12;
|
52
|
+
repeated uint64 extra_double_counter_track_uuids = 45;
|
53
|
+
repeated double extra_double_counter_values = 46;
|
54
|
+
repeated fixed64 flow_ids = 47;
|
55
|
+
repeated fixed64 terminating_flow_ids = 48;
|
56
|
+
repeated DebugAnnotation debug_annotations = 4;
|
57
|
+
}
|
58
|
+
|
59
|
+
message DebugAnnotation {
|
60
|
+
oneof name_field {
|
61
|
+
uint64 name_iid = 1;
|
62
|
+
string name = 10;
|
63
|
+
}
|
64
|
+
oneof value {
|
65
|
+
bool bool_value = 2;
|
66
|
+
uint64 uint_value = 3;
|
67
|
+
int64 int_value = 4;
|
68
|
+
double double_value = 5;
|
69
|
+
string string_value = 6;
|
70
|
+
uint64 string_value_iid = 17;
|
71
|
+
}
|
72
|
+
repeated DebugAnnotation dict_entries = 11;
|
73
|
+
repeated DebugAnnotation array_values = 12;
|
74
|
+
uint64 string_value_iid = 17;
|
75
|
+
}
|
76
|
+
|
77
|
+
message TrackDescriptor {
|
78
|
+
optional uint64 uuid = 1;
|
79
|
+
optional uint64 parent_uuid = 5;
|
80
|
+
|
81
|
+
oneof static_or_dynamic_name {
|
82
|
+
string name = 2;
|
83
|
+
}
|
84
|
+
|
85
|
+
optional CounterDescriptor counter = 8;
|
86
|
+
enum ChildTracksOrdering {
|
87
|
+
UNKNOWN = 0;
|
88
|
+
LEXICOGRAPHIC = 1;
|
89
|
+
CHRONOLOGICAL = 2;
|
90
|
+
EXPLICIT = 3;
|
91
|
+
}
|
92
|
+
optional ChildTracksOrdering child_ordering = 11;
|
93
|
+
optional int32 sibling_order_rank = 12;
|
94
|
+
}
|
95
|
+
|
96
|
+
message CounterDescriptor {
|
97
|
+
enum BuiltinCounterType {
|
98
|
+
COUNTER_UNSPECIFIED = 0;
|
99
|
+
COUNTER_THREAD_TIME_NS = 1;
|
100
|
+
COUNTER_THREAD_INSTRUCTION_COUNT = 2;
|
101
|
+
}
|
102
|
+
enum Unit {
|
103
|
+
UNIT_UNSPECIFIED = 0;
|
104
|
+
UNIT_TIME_NS = 1;
|
105
|
+
UNIT_COUNT = 2;
|
106
|
+
UNIT_SIZE_BYTES = 3;
|
107
|
+
}
|
108
|
+
optional BuiltinCounterType type = 1;
|
109
|
+
repeated string categories = 2;
|
110
|
+
optional Unit unit = 3;
|
111
|
+
optional string unit_name = 6;
|
112
|
+
optional int64 unit_multiplier = 4;
|
113
|
+
optional bool is_incremental = 5;
|
114
|
+
}
|
115
|
+
|
116
|
+
message InternedData {
|
117
|
+
repeated EventCategory event_categories = 1;
|
118
|
+
repeated EventName event_names = 2;
|
119
|
+
repeated DebugAnnotationName debug_annotation_names = 3;
|
120
|
+
repeated InternedString debug_annotation_string_values = 29;
|
121
|
+
}
|
122
|
+
|
123
|
+
message InternedString {
|
124
|
+
optional uint64 iid = 1;
|
125
|
+
optional bytes str = 2;
|
126
|
+
}
|
127
|
+
|
128
|
+
message EventCategory {
|
129
|
+
optional uint64 iid = 1;
|
130
|
+
optional string name = 2;
|
131
|
+
}
|
132
|
+
|
133
|
+
message EventName {
|
134
|
+
optional uint64 iid = 1;
|
135
|
+
optional string name = 2;
|
136
|
+
}
|
137
|
+
|
138
|
+
message DebugAnnotationName {
|
139
|
+
optional uint64 iid = 1;
|
140
|
+
optional string name = 2;
|
141
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: trace.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
|
8
|
+
descriptor_data = "\n\x0btrace.proto\x12\x15perfetto_trace.protos\";\n\x05Trace\x12\x32\n\x06packet\x18\x01 \x03(\x0b\x32\".perfetto_trace.protos.TracePacket\"\x8a\x03\n\x0bTracePacket\x12\x11\n\ttimestamp\x18\x08 \x01(\x04\x12\x38\n\x0btrack_event\x18\x0b \x01(\x0b\x32!.perfetto_trace.protos.TrackEventH\x00\x12\x42\n\x10track_descriptor\x18< \x01(\x0b\x32&.perfetto_trace.protos.TrackDescriptorH\x00\x12$\n\x1atrusted_packet_sequence_id\x18\n \x01(\rH\x01\x12:\n\rinterned_data\x18\x0c \x01(\x0b\x32#.perfetto_trace.protos.InternedData\x12 \n\x18\x66irst_packet_on_sequence\x18W \x01(\x08\x12\x1f\n\x17previous_packet_dropped\x18* \x01(\x08\x12\x16\n\x0esequence_flags\x18\r \x01(\rB\x06\n\x04\x64\x61taB%\n#optional_trusted_packet_sequence_id\"\xf2\x04\n\nTrackEvent\x12\x15\n\rcategory_iids\x18\x03 \x03(\x04\x12\x12\n\ncategories\x18\x16 \x03(\t\x12\x12\n\x08name_iid\x18\n \x01(\x04H\x00\x12\x0e\n\x04name\x18\x17 \x01(\tH\x00\x12\x34\n\x04type\x18\t \x01(\x0e\x32&.perfetto_trace.protos.TrackEvent.Type\x12\x12\n\ntrack_uuid\x18\x0b \x01(\x04\x12\x17\n\rcounter_value\x18\x1e \x01(\x03H\x01\x12\x1e\n\x14\x64ouble_counter_value\x18, \x01(\x01H\x01\x12!\n\x19\x65xtra_counter_track_uuids\x18\x1f \x03(\x04\x12\x1c\n\x14\x65xtra_counter_values\x18\x0c \x03(\x03\x12(\n extra_double_counter_track_uuids\x18- \x03(\x04\x12#\n\x1b\x65xtra_double_counter_values\x18. \x03(\x01\x12\x10\n\x08\x66low_ids\x18/ \x03(\x06\x12\x1c\n\x14terminating_flow_ids\x18\x30 \x03(\x06\x12\x41\n\x11\x64\x65\x62ug_annotations\x18\x04 \x03(\x0b\x32&.perfetto_trace.protos.DebugAnnotation\"j\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10TYPE_SLICE_BEGIN\x10\x01\x12\x12\n\x0eTYPE_SLICE_END\x10\x02\x12\x10\n\x0cTYPE_INSTANT\x10\x03\x12\x10\n\x0cTYPE_COUNTER\x10\x04\x42\x0c\n\nname_fieldB\x15\n\x13\x63ounter_value_field\"\xd5\x02\n\x0f\x44\x65\x62ugAnnotation\x12\x12\n\x08name_iid\x18\x01 \x01(\x04H\x00\x12\x0e\n\x04name\x18\n \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x01\x12\x14\n\nuint_value\x18\x03 \x01(\x04H\x01\x12\x13\n\tint_value\x18\x04 \x01(\x03H\x01\x12\x16\n\x0c\x64ouble_value\x18\x05 \x01(\x01H\x01\x12\x16\n\x0cstring_value\x18\x06 \x01(\tH\x01\x12\x1a\n\x10string_value_iid\x18\x11 \x01(\x04H\x01\x12<\n\x0c\x64ict_entries\x18\x0b \x03(\x0b\x32&.perfetto_trace.protos.DebugAnnotation\x12<\n\x0c\x61rray_values\x18\x0c \x03(\x0b\x32&.perfetto_trace.protos.DebugAnnotationB\x0c\n\nname_fieldB\x07\n\x05value\"\xe1\x02\n\x0fTrackDescriptor\x12\x0c\n\x04uuid\x18\x01 \x01(\x04\x12\x13\n\x0bparent_uuid\x18\x05 \x01(\x04\x12\x0e\n\x04name\x18\x02 \x01(\tH\x00\x12\x39\n\x07\x63ounter\x18\x08 \x01(\x0b\x32(.perfetto_trace.protos.CounterDescriptor\x12R\n\x0e\x63hild_ordering\x18\x0b \x01(\x0e\x32:.perfetto_trace.protos.TrackDescriptor.ChildTracksOrdering\x12\x1a\n\x12sibling_order_rank\x18\x0c \x01(\x05\"V\n\x13\x43hildTracksOrdering\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rLEXICOGRAPHIC\x10\x01\x12\x11\n\rCHRONOLOGICAL\x10\x02\x12\x0c\n\x08\x45XPLICIT\x10\x03\x42\x18\n\x16static_or_dynamic_name\"\xb9\x03\n\x11\x43ounterDescriptor\x12I\n\x04type\x18\x01 \x01(\x0e\x32;.perfetto_trace.protos.CounterDescriptor.BuiltinCounterType\x12\x12\n\ncategories\x18\x02 \x03(\t\x12;\n\x04unit\x18\x03 \x01(\x0e\x32-.perfetto_trace.protos.CounterDescriptor.Unit\x12\x11\n\tunit_name\x18\x06 \x01(\t\x12\x17\n\x0funit_multiplier\x18\x04 \x01(\x03\x12\x16\n\x0eis_incremental\x18\x05 \x01(\x08\"o\n\x12\x42uiltinCounterType\x12\x17\n\x13\x43OUNTER_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x43OUNTER_THREAD_TIME_NS\x10\x01\x12$\n COUNTER_THREAD_INSTRUCTION_COUNT\x10\x02\"S\n\x04Unit\x12\x14\n\x10UNIT_UNSPECIFIED\x10\x00\x12\x10\n\x0cUNIT_TIME_NS\x10\x01\x12\x0e\n\nUNIT_COUNT\x10\x02\x12\x13\n\x0fUNIT_SIZE_BYTES\x10\x03\"\xa0\x02\n\x0cInternedData\x12>\n\x10\x65vent_categories\x18\x01 \x03(\x0b\x32$.perfetto_trace.protos.EventCategory\x12\x35\n\x0b\x65vent_names\x18\x02 \x03(\x0b\x32 .perfetto_trace.protos.EventName\x12J\n\x16\x64\x65\x62ug_annotation_names\x18\x03 \x03(\x0b\x32*.perfetto_trace.protos.DebugAnnotationName\x12M\n\x1e\x64\x65\x62ug_annotation_string_values\x18\x1d \x03(\x0b\x32%.perfetto_trace.protos.InternedString\"*\n\x0eInternedString\x12\x0b\n\x03iid\x18\x01 \x01(\x04\x12\x0b\n\x03str\x18\x02 \x01(\x0c\"*\n\rEventCategory\x12\x0b\n\x03iid\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\"&\n\tEventName\x12\x0b\n\x03iid\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\"0\n\x13\x44\x65\x62ugAnnotationName\x12\x0b\n\x03iid\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\tB\"\xea\x02\x1fGraphQL::Tracing::PerfettoTrace"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
pool.add_serialized_file(descriptor_data)
|
12
|
+
|
13
|
+
module GraphQL
|
14
|
+
module Tracing
|
15
|
+
module PerfettoTrace
|
16
|
+
Trace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.Trace").msgclass
|
17
|
+
TracePacket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.TracePacket").msgclass
|
18
|
+
TrackEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.TrackEvent").msgclass
|
19
|
+
TrackEvent::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.TrackEvent.Type").enummodule
|
20
|
+
DebugAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.DebugAnnotation").msgclass
|
21
|
+
TrackDescriptor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.TrackDescriptor").msgclass
|
22
|
+
TrackDescriptor::ChildTracksOrdering = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.TrackDescriptor.ChildTracksOrdering").enummodule
|
23
|
+
CounterDescriptor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.CounterDescriptor").msgclass
|
24
|
+
CounterDescriptor::BuiltinCounterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.CounterDescriptor.BuiltinCounterType").enummodule
|
25
|
+
CounterDescriptor::Unit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.CounterDescriptor.Unit").enummodule
|
26
|
+
InternedData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.InternedData").msgclass
|
27
|
+
InternedString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.InternedString").msgclass
|
28
|
+
EventCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.EventCategory").msgclass
|
29
|
+
EventName = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.EventName").msgclass
|
30
|
+
DebugAnnotationName = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("perfetto_trace.protos.DebugAnnotationName").msgclass
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|