@@ -169,6 +169,20 @@ export interface SpandSlowEndpointsInsight extends CodeObjectInsight{
169169 slowEndpoints :SlowEndpointInfo [ ]
170170}
171171
172+ export interface NPlusSpansInsight extends CodeObjectInsight {
173+ traceId : string ;
174+ span : SpanInfo ;
175+ clientSpanName : string ;
176+ occurrences : number ;
177+ duration : Duration ;
178+ }
179+
180+ export interface SpanScalingInsight extends CodeObjectInsight {
181+ spanName : string ;
182+ turningPointConcurrency : number ;
183+ maxConcurrency : number ;
184+ }
185+
172186export class SpanDurationsListViewItemsCreator implements IInsightListViewItemsCreator {
173187
174188 public constructor ( private _viewUris :WebViewUris ) {
@@ -408,14 +422,6 @@ P99: ${(span.p99.fraction*100).toFixed(0)}% ~${span.p99.maxDuration.value}${s
408422
409423}
410424
411- export interface NPlusSpansInsight extends CodeObjectInsight {
412- traceId : string ;
413- span : SpanInfo ;
414- clientSpanName : string ;
415- occurrences : number ;
416- duration : Duration ;
417- }
418-
419425export class NPlusSpansListViewItemsCreator implements IInsightListViewItemsCreator {
420426 constructor (
421427 private _viewUris : WebViewUris
@@ -477,3 +483,45 @@ export class NPlusSpansListViewItemsCreator implements IInsightListViewItemsCrea
477483
478484}
479485
486+ export class SpanScalingListViewItemsCreator implements IInsightListViewItemsCreator {
487+ constructor (
488+ private _viewUris : WebViewUris
489+
490+ ) {
491+
492+ }
493+
494+ public async createListViewItem ( codeObjectsInsight : SpanScalingInsight ) : Promise < IListViewItem > {
495+
496+ const template = new InsightTemplateHtml ( {
497+ title : {
498+ text :"Scaling Issue Found" ,
499+ tooltip : ""
500+ } ,
501+ description : `Significant performance degradation at ${ codeObjectsInsight . turningPointConcurrency } executions/second` ,
502+ icon : this . _viewUris . image ( "scale.svg" ) ,
503+ body : `<div>
504+ Tested concurrency: ${ codeObjectsInsight . maxConcurrency }
505+ </div>` ,
506+ insight : codeObjectsInsight ,
507+ } , this . _viewUris ) ;
508+
509+ return {
510+ getHtml : ( ) => template . renderHtml ( ) ,
511+ sortIndex : 0 ,
512+ groupId : codeObjectsInsight . spanName
513+ } ;
514+ }
515+
516+
517+ public async create ( codeObjectsInsight : SpanScalingInsight [ ] ) : Promise < IListViewItem [ ] > {
518+
519+ let items :IListViewItem [ ] = [ ] ;
520+ for ( const insight of codeObjectsInsight ) {
521+ items . push ( await this . createListViewItem ( insight ) ) ;
522+
523+ }
524+ return items ;
525+ }
526+
527+ }
0 commit comments