forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#4044][WEB/UI] add Apdex Score UI
- Loading branch information
1 parent
3d54abe
commit 7ab8b70
Showing
22 changed files
with
229 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
web/src/main/angular/src/app/core/components/apdex-score/apdex-score.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
:host { | ||
font-size: 16px; | ||
} | ||
|
||
div { | ||
cursor: pointer; | ||
margin-left: 15px; | ||
} | ||
|
||
.title { | ||
position: relative; | ||
margin-right: 15px; | ||
} | ||
|
||
.score { | ||
font-weight: bold; | ||
} | ||
|
||
button { | ||
position: absolute; | ||
top: 1px; | ||
right: -6.5px; | ||
font-size: 0.6em; | ||
opacity: 0.7; | ||
} | ||
|
||
.excellent { | ||
color: var(--status-success); | ||
} | ||
.good { | ||
color: var(--status-good); | ||
} | ||
.poor { | ||
color: var(--status-warn); | ||
} | ||
.unacceptable { | ||
color: var(--status-fail); | ||
} |
7 changes: 7 additions & 0 deletions
7
web/src/main/angular/src/app/core/components/apdex-score/apdex-score.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="helper-viewer-exclude" (click)="onShowHelp($event)"> | ||
<span class="title"> | ||
Apdex | ||
<button class="fa fa-question-circle"></button> | ||
</span> | ||
<span class={{getScoreTextClassName()}}>{{ fixedScore }}</span> | ||
</div> |
80 changes: 80 additions & 0 deletions
80
web/src/main/angular/src/app/core/components/apdex-score/apdex-score.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { Component, ComponentFactoryResolver, Injector, Input, OnInit, SimpleChanges } from '@angular/core'; | ||
import { AnalyticsService, DynamicPopupService, TRACKED_EVENT_LIST } from 'app/shared/services'; | ||
|
||
import { HELP_VIEWER_LIST, HelpViewerPopupContainerComponent } from 'app/core/components/help-viewer-popup/help-viewer-popup-container.component'; | ||
|
||
const enum APDEX_SCORE_RANK { | ||
EXCELLENT = 'excellent', | ||
GOOD = 'good', | ||
FAIR = 'fair', | ||
POOR = 'poor', | ||
UNACCEPTABLE = 'unacceptable', | ||
} | ||
|
||
@Component({ | ||
selector: 'pp-apdex-score', | ||
templateUrl: './apdex-score.component.html', | ||
styleUrls: ['./apdex-score.component.css'] | ||
}) | ||
export class ApdexScoreComponent implements OnInit { | ||
@Input() score: number; | ||
|
||
fixedScore: string; | ||
|
||
constructor( | ||
private injector: Injector, | ||
private analyticsService: AnalyticsService, | ||
private dynamicPopupService: DynamicPopupService, | ||
private componentFactoryResolver: ComponentFactoryResolver, | ||
) { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
ngOnChanges(changes: SimpleChanges) { | ||
const score = changes.score.currentValue | ||
|
||
if (!isNaN(Number(score))) { | ||
this.fixedScore = (score as number).toFixed(2); | ||
} | ||
} | ||
|
||
getScoreTextClassName() { | ||
let className = ''; | ||
|
||
if (!this.score) { | ||
return 'score'; | ||
} | ||
|
||
if (this.score < 0.5) { | ||
className = APDEX_SCORE_RANK.UNACCEPTABLE; | ||
} else if (this.score < 0.7) { | ||
className = APDEX_SCORE_RANK.POOR; | ||
} else if (this.score < 0.85) { | ||
className = APDEX_SCORE_RANK.FAIR; | ||
} else if (this.score < 0.94) { | ||
className = APDEX_SCORE_RANK.GOOD; | ||
} else { | ||
className = APDEX_SCORE_RANK.EXCELLENT; | ||
} | ||
|
||
return `score ${className}`; | ||
} | ||
|
||
onShowHelp($event: MouseEvent): void { | ||
this.analyticsService.trackEvent(TRACKED_EVENT_LIST.CLICK_APDEX_SCORE, HELP_VIEWER_LIST.APDEX_SCORE); | ||
const { left, top, height } = ($event.target as HTMLElement).getBoundingClientRect(); | ||
|
||
this.dynamicPopupService.openPopup({ | ||
data: HELP_VIEWER_LIST.APDEX_SCORE, | ||
coord: { | ||
coordX: left, | ||
coordY: top + height / 2 | ||
}, | ||
component: HelpViewerPopupContainerComponent | ||
}, { | ||
resolver: this.componentFactoryResolver, | ||
injector: this.injector | ||
}); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
web/src/main/angular/src/app/core/components/apdex-score/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { SharedModule } from 'app/shared'; | ||
import { HelpViewerPopupModule } from 'app/core/components/help-viewer-popup'; | ||
import { ApdexScoreComponent } from './apdex-score.component'; | ||
import { ApplicationNameIssuePopupModule } from '../application-name-issue-popup'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
ApdexScoreComponent, | ||
], | ||
imports: [ | ||
HelpViewerPopupModule, | ||
ApplicationNameIssuePopupModule, | ||
SharedModule | ||
], | ||
exports: [ | ||
ApdexScoreComponent, | ||
], | ||
providers: [ | ||
] | ||
}) | ||
export class ApdexScoreModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ | |
} | ||
|
||
.category-list { | ||
padding: 14px 8px; | ||
padding: 14px 14px; | ||
} | ||
|
||
.category-list:not(:last-of-type) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...rc/main/angular/src/app/core/components/scatter-chart/scatter-chart-options.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
...c/main/angular/src/app/core/components/scatter-chart/scatter-chart-options.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
<div class="l-tool-box"> | ||
<button [hidden]="hiddenOptions.setting" class="fas fa-cog" (click)="outShowSetting.emit()"></button> | ||
<button [hidden]="hiddenOptions.download" class="fas fa-download" (click)="outDownload.emit()"></button> | ||
<button [hidden]="hiddenOptions.open" class="fas fa-expand-arrows-alt" (click)="outOpenScatterPage.emit()"></button> | ||
<button [hidden]="hiddenOptions.help" class="fas fa-question-circle l-last-child" (click)="onShowHelp($event)"></button> | ||
<pp-apdex-score [score]="apdexScore"></pp-apdex-score> | ||
<div> | ||
<button [hidden]="hiddenOptions.setting" class="fas fa-cog" (click)="outShowSetting.emit()"></button> | ||
<button [hidden]="hiddenOptions.download" class="fas fa-download" (click)="outDownload.emit()"></button> | ||
<button [hidden]="hiddenOptions.open" class="fas fa-expand-arrows-alt" (click)="outOpenScatterPage.emit()"></button> | ||
<button [hidden]="hiddenOptions.help" class="fas fa-question-circle l-last-child" (click)="onShowHelp($event)"></button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.