11import { ChangeDetectionStrategy , Component } from '@angular/core' ;
22import { MetricAggregationType } from '@hypertrace/distributed-tracing' ;
33import { ModelJson } from '@hypertrace/hyperdash' ;
4+ import {
5+ defaultPrimaryEdgeMetricCategories ,
6+ defaultSecondaryEdgeMetricCategories
7+ } from './../../../shared/dashboard/widgets/topology/metric/edge-metric-category' ;
8+ import {
9+ defaultPrimaryNodeMetricCategories ,
10+ defaultSecondaryNodeMetricCategories
11+ } from './../../../shared/dashboard/widgets/topology/metric/node-metric-category' ;
412
513@Component ( {
614 changeDetection : ChangeDetectionStrategy . OnPush ,
@@ -26,78 +34,182 @@ export class ApplicationFlowComponent {
2634 type : 'topology-data-source' ,
2735 entity : 'SERVICE' ,
2836 'downstream-entities' : [ 'SERVICE' , 'BACKEND' ] ,
29- 'node-metrics' : [
30- {
31- type : 'percentile-latency-metric-aggregation' ,
32- 'display-name' : 'P99 Latency'
37+ 'edge-metrics' : {
38+ type : 'topology-metrics' ,
39+ primary : {
40+ type : 'topology-metric-with-category' ,
41+ specification : {
42+ type : 'percentile-latency-metric-aggregation' ,
43+ 'display-name' : 'P99 Latency'
44+ } ,
45+ categories : [
46+ {
47+ type : 'topology-metric-category' ,
48+ ...defaultPrimaryEdgeMetricCategories [ 0 ]
49+ } ,
50+ {
51+ type : 'topology-metric-category' ,
52+ ...defaultPrimaryEdgeMetricCategories [ 1 ]
53+ } ,
54+ {
55+ type : 'topology-metric-category' ,
56+ ...defaultPrimaryEdgeMetricCategories [ 2 ]
57+ } ,
58+ {
59+ type : 'topology-metric-category' ,
60+ ...defaultPrimaryEdgeMetricCategories [ 3 ]
61+ } ,
62+ {
63+ type : 'topology-metric-category' ,
64+ ...defaultPrimaryEdgeMetricCategories [ 4 ]
65+ }
66+ ]
3367 } ,
34- {
35- type : 'metric-aggregation' ,
36- metric : 'duration' ,
37- aggregation : MetricAggregationType . P50 ,
38- 'display-name' : 'P50 Latency'
68+ secondary : {
69+ type : 'topology-metric-with-category' ,
70+ specification : {
71+ type : 'error-percentage-metric-aggregation' ,
72+ aggregation : MetricAggregationType . Average ,
73+ 'display-name' : 'Error %'
74+ } ,
75+ categories : [
76+ {
77+ type : 'topology-metric-category' ,
78+ ...defaultSecondaryEdgeMetricCategories [ 0 ]
79+ } ,
80+ {
81+ type : 'topology-metric-category' ,
82+ ...defaultSecondaryEdgeMetricCategories [ 1 ]
83+ }
84+ ]
3985 } ,
40- {
41- type : 'error-percentage-metric-aggregation' ,
42- aggregation : MetricAggregationType . Average ,
43- 'display-name' : 'Error %'
86+ others : [
87+ {
88+ type : 'topology-metric-with-category' ,
89+ specification : {
90+ type : 'metric-aggregation' ,
91+ metric : 'duration' ,
92+ aggregation : MetricAggregationType . P50 ,
93+ 'display-name' : 'P50 Latency'
94+ }
95+ } ,
96+ {
97+ type : 'topology-metric-with-category' ,
98+ specification : {
99+ type : 'metric-aggregation' ,
100+ metric : 'errorCount' ,
101+ aggregation : MetricAggregationType . Sum ,
102+ 'display-name' : 'Error Count'
103+ }
104+ } ,
105+ {
106+ type : 'topology-metric-with-category' ,
107+ specification : {
108+ type : 'metric-aggregation' ,
109+ metric : 'numCalls' ,
110+ aggregation : MetricAggregationType . AvgrateSecond ,
111+ 'display-name' : 'Call Rate/sec'
112+ }
113+ } ,
114+ {
115+ type : 'topology-metric-with-category' ,
116+ specification : {
117+ type : 'metric-aggregation' ,
118+ metric : 'numCalls' ,
119+ aggregation : MetricAggregationType . Sum ,
120+ 'display-name' : 'Call Count'
121+ }
122+ }
123+ ]
124+ } ,
125+ 'node-metrics' : {
126+ type : 'topology-metrics' ,
127+ primary : {
128+ type : 'topology-metric-with-category' ,
129+ specification : {
130+ type : 'percentile-latency-metric-aggregation' ,
131+ 'display-name' : 'P99 Latency'
132+ } ,
133+ categories : [
134+ {
135+ type : 'topology-metric-category' ,
136+ ...defaultPrimaryNodeMetricCategories [ 0 ]
137+ } ,
138+ {
139+ type : 'topology-metric-category' ,
140+ ...defaultPrimaryNodeMetricCategories [ 1 ]
141+ } ,
142+ {
143+ type : 'topology-metric-category' ,
144+ ...defaultPrimaryNodeMetricCategories [ 2 ]
145+ } ,
146+ {
147+ type : 'topology-metric-category' ,
148+ ...defaultPrimaryNodeMetricCategories [ 3 ]
149+ } ,
150+ {
151+ type : 'topology-metric-category' ,
152+ ...defaultPrimaryNodeMetricCategories [ 4 ]
153+ }
154+ ]
44155 } ,
45-
46- {
47- type : 'metric-aggregation' ,
48- metric : 'errorCount' ,
49- aggregation : MetricAggregationType . Sum ,
50- 'display-name' : 'Error Count'
51- } ,
52- {
53- type : 'metric-aggregation' ,
54- metric : 'numCalls' ,
55- aggregation : MetricAggregationType . AvgrateSecond ,
56- 'display-name' : 'Call Rate/sec'
57- } ,
58- {
59- type : 'metric-aggregation' ,
60- metric : 'numCalls' ,
61- aggregation : MetricAggregationType . Sum ,
62- 'display-name' : 'Call Count'
63- }
64- ] ,
65- 'edge-metrics' : [
66- {
67- type : 'percentile-latency-metric-aggregation' ,
68- 'display-name' : 'P99 Latency'
69- } ,
70- {
71- type : 'metric-aggregation' ,
72- metric : 'duration' ,
73- aggregation : MetricAggregationType . P50 ,
74- 'display-name' : 'P50 Latency'
75- } ,
76- {
77- type : 'error-percentage-metric-aggregation' ,
78- aggregation : MetricAggregationType . Average ,
79- 'display-name' : 'Error %'
80- } ,
81-
82- {
83- type : 'metric-aggregation' ,
84- metric : 'errorCount' ,
85- aggregation : MetricAggregationType . Sum ,
86- 'display-name' : 'Error Count'
87- } ,
88- {
89- type : 'metric-aggregation' ,
90- metric : 'numCalls' ,
91- aggregation : MetricAggregationType . AvgrateSecond ,
92- 'display-name' : 'Call Rate/sec'
156+ secondary : {
157+ type : 'topology-metric-with-category' ,
158+ specification : {
159+ type : 'error-percentage-metric-aggregation' ,
160+ aggregation : MetricAggregationType . Average ,
161+ 'display-name' : 'Error %'
162+ } ,
163+ categories : [
164+ {
165+ type : 'topology-metric-category' ,
166+ ...defaultSecondaryNodeMetricCategories [ 0 ]
167+ } ,
168+ {
169+ type : 'topology-metric-category' ,
170+ ...defaultSecondaryNodeMetricCategories [ 1 ]
171+ }
172+ ]
93173 } ,
94- {
95- type : 'metric-aggregation' ,
96- metric : 'numCalls' ,
97- aggregation : MetricAggregationType . Sum ,
98- 'display-name' : 'Call Count'
99- }
100- ]
174+ others : [
175+ {
176+ type : 'topology-metric-with-category' ,
177+ specification : {
178+ type : 'metric-aggregation' ,
179+ metric : 'duration' ,
180+ aggregation : MetricAggregationType . P50 ,
181+ 'display-name' : 'P50 Latency'
182+ }
183+ } ,
184+ {
185+ type : 'topology-metric-with-category' ,
186+ specification : {
187+ type : 'metric-aggregation' ,
188+ metric : 'errorCount' ,
189+ aggregation : MetricAggregationType . Sum ,
190+ 'display-name' : 'Error Count'
191+ }
192+ } ,
193+ {
194+ type : 'topology-metric-with-category' ,
195+ specification : {
196+ type : 'metric-aggregation' ,
197+ metric : 'numCalls' ,
198+ aggregation : MetricAggregationType . AvgrateSecond ,
199+ 'display-name' : 'Call Rate/sec'
200+ }
201+ } ,
202+ {
203+ type : 'topology-metric-with-category' ,
204+ specification : {
205+ type : 'metric-aggregation' ,
206+ metric : 'numCalls' ,
207+ aggregation : MetricAggregationType . Sum ,
208+ 'display-name' : 'Call Count'
209+ }
210+ }
211+ ]
212+ }
101213 }
102214 }
103215 ]
0 commit comments