|
1 | 1 | import moment = require("moment"); |
2 | 2 | import { Uri } from "vscode"; |
3 | | -import { decimal } from "vscode-languageclient"; |
4 | | -import { EndpointSchema, UsageStatusResults } from "../../../services/analyticsProvider"; |
5 | | -import { CodeObjectId } from "../../../services/codeObject"; |
| 3 | +import { EndpointSchema } from "../../../services/analyticsProvider"; |
6 | 4 | import { DocumentInfoProvider } from "../../../services/documentInfoProvider"; |
7 | 5 | import { EditorHelper } from "../../../services/EditorHelper"; |
8 | 6 | import { SpanLocationInfo } from "../../../services/languages/extractors"; |
9 | | -import { Settings } from "../../../settings"; |
10 | 7 | import { UiMessage } from "../../../views-ui/codeAnalytics/contracts"; |
11 | | -import { IListViewItem, IListViewItemBase, InsightListGroupItemsRenderer } from "../../ListView/IListViewItem"; |
| 8 | +import { IListViewItem, IListViewItemBase } from "../../ListView/IListViewItem"; |
12 | 9 | import { WebviewChannel, WebViewUris } from "../../webViewUtils"; |
13 | 10 | import { SpanSearch } from "./Common/SpanSearch"; |
14 | 11 | import { renderTraceLink } from "./Common/TraceLinkRender"; |
@@ -148,13 +145,10 @@ export interface EndpointInfo { |
148 | 145 | export interface SlowEndpointInfo{ |
149 | 146 |
|
150 | 147 | endpointInfo: EndpointInfo, |
151 | | - probabilityOfBeingBottleneck?: number, |
152 | | - avgDurationWhenBeingBottleneck?: Duration, |
153 | | - |
154 | | - // Obsolete |
155 | 148 | p50: Percentile, |
156 | 149 | p95: Percentile, |
157 | 150 | p99: Percentile, |
| 151 | + |
158 | 152 | } |
159 | 153 | export interface SpandSlowEndpointsInsight extends CodeObjectInsight{ |
160 | 154 | span: SpanInfo, |
@@ -282,72 +276,14 @@ export class SpanDurationBreakdownListViewItemsCreator implements IInsightListVi |
282 | 276 | htmlRecords.push(htmlRecord); |
283 | 277 | }); |
284 | 278 | const body = /*html*/ ` |
285 | | - <div class="span-duration-breakdown-insight"> |
286 | | - ${htmlRecords.join('')} |
287 | | - <div class="nav"> |
288 | | - <a class="prev">Prev</a> |
289 | | - <a class="next">Next</a> |
290 | | - <span class="page"></span> |
291 | | - </div> |
292 | | - <script type="text/javascript"> |
293 | | - var current_page = 1; |
294 | | - var records_per_page = ${recordsPerPage}; |
295 | | - var numOfItems = $('.span-duration-breakdown-insight .item').length; |
296 | | - var numOfPages = Math.ceil(numOfItems/records_per_page); |
297 | | - function prevPage() |
298 | | - { |
299 | | - if (current_page > 1) { |
300 | | - current_page--; |
301 | | - changePage(current_page); |
302 | | - } |
303 | | - } |
304 | | - |
305 | | - function nextPage() |
306 | | - { |
307 | | - if (current_page < numOfPages) { |
308 | | - current_page++; |
309 | | - changePage(current_page); |
310 | | - } |
311 | | - } |
312 | | - |
313 | | -
|
314 | | - function changePage(page) { |
315 | | - $(".span-duration-breakdown-insight .item").hide(); |
316 | | - $('.span-duration-breakdown-insight .item').each(function(){ |
317 | | - var index = $(this).data('index'); |
318 | | - if(index<current_page*records_per_page && index>=(current_page-1)*records_per_page){ |
319 | | - $(this).show(); |
320 | | - } |
321 | | - }); |
322 | | - |
323 | | - if(numOfPages > 1){ |
324 | | - $('.span-duration-breakdown-insight .page').html(current_page+" of "+numOfPages+" pages") |
325 | | - |
326 | | - if(page>1){ |
327 | | - $(".span-duration-breakdown-insight .prev").removeClass("disabled"); |
328 | | - }else{ |
329 | | - $(".span-duration-breakdown-insight .prev").addClass("disabled"); |
330 | | - } |
331 | | - if(page<numOfPages){ |
332 | | - $(".span-duration-breakdown-insight .next").removeClass("disabled"); |
333 | | - }else{ |
334 | | - $(".span-duration-breakdown-insight .next").addClass("disabled"); |
335 | | - } |
336 | | - } else{ |
337 | | - $(".span-duration-breakdown-insight .nav").hide(); |
338 | | - } |
339 | | - |
340 | | - } |
341 | | - $(".span-duration-breakdown-insight .next").click(function() { |
342 | | - nextPage(); |
343 | | - }) |
344 | | - $(".span-duration-breakdown-insight .prev").click(function() { |
345 | | - prevPage(); |
346 | | - }) |
347 | | - changePage(1); |
348 | | - </script> |
349 | | - </div> |
350 | | - `; |
| 279 | + <div class="span-duration-breakdown-insight pagination-list" data-current-page="1" data-records-per-page="3"> |
| 280 | + ${htmlRecords.join('')} |
| 281 | + <div class="pagination-nav"> |
| 282 | + <a class="prev">Prev</a> |
| 283 | + <a class="next">Next</a> |
| 284 | + <span class="page"></span> |
| 285 | + </div> |
| 286 | + </div>`; |
351 | 287 |
|
352 | 288 | return new InsightTemplateHtml({ |
353 | 289 | title: "Duration Breakdown", |
@@ -427,17 +363,11 @@ export class SpanEndpointBottlenecksListViewItemsCreator implements IInsightList |
427 | 363 | } |
428 | 364 |
|
429 | 365 | private getDescription(span: SlowEndpointInfo){ |
430 | | - if(span.probabilityOfBeingBottleneck && span.avgDurationWhenBeingBottleneck) |
431 | | - { |
432 | | - return `Slowing ${(span.probabilityOfBeingBottleneck*100).toFixed(0)}% of the requests (~${span.avgDurationWhenBeingBottleneck.value}${span.avgDurationWhenBeingBottleneck.unit})`; |
433 | | - } |
434 | | - else { // Obsolete |
435 | | - if (span.p95){ |
436 | | - return `Up to ~${(span.p95.fraction*100.0).toFixed(3)}% of the entire request time (${span.p95.maxDuration.value}${span.p95.maxDuration.unit}).`; |
| 366 | + if (span.p95){ |
| 367 | + return `Up to ~${(span.p95.fraction*100.0).toFixed(3)}% of the entire request time (${span.p95.maxDuration.value}${span.p95.maxDuration.unit}).`; |
437 | 368 |
|
438 | | - } |
439 | | - return `Up to ~${(span.p50.fraction*100.0).toFixed(3)}% of the entire request time (${span.p50.maxDuration.value}${span.p50.maxDuration.unit}).`; |
440 | 369 | } |
| 370 | + return `Up to ~${(span.p50.fraction*100.0).toFixed(3)}% of the entire request time (${span.p50.maxDuration.value}${span.p50.maxDuration.unit}).`; |
441 | 371 | } |
442 | 372 |
|
443 | 373 | private getTooltip(span: SlowEndpointInfo){ |
|
0 commit comments