File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
src/components/QueriesActivityBar Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {chartApi} from '../MetricChart/reducer';
16
16
17
17
import { QueriesActivityCharts } from './QueriesActivityCharts' ;
18
18
import i18n from './i18n' ;
19
- import { calculateLatency , calculateQueriesPerSecond } from './utils' ;
19
+ import { calculateLatency , calculateQueriesPerSecond , formatTrendValue } from './utils' ;
20
20
21
21
import './QueriesActivityBar.scss' ;
22
22
@@ -108,17 +108,6 @@ export function QueriesActivityBar({tenantName}: QueriesActivityBarProps) {
108
108
history . push ( path ) ;
109
109
} ;
110
110
111
- // Helper to format trend display
112
- const formatTrendValue = ( val : number ) => {
113
- if ( val >= 1 ) {
114
- return `+${ val . toFixed ( 0 ) } ` ;
115
- } else if ( val > 0 ) {
116
- return `+${ val . toFixed ( 1 ) } ` ;
117
- } else {
118
- return val . toFixed ( 1 ) ;
119
- }
120
- } ;
121
-
122
111
return (
123
112
< div className = { b ( { expanded} ) } >
124
113
< Disclosure expanded = { expanded } onUpdate = { setExpanded } className = { b ( 'disclosure' ) } >
Original file line number Diff line number Diff line change @@ -86,3 +86,16 @@ export const calculateLatency = (data?: (number | null)[]): MetricCalculationRes
86
86
87
87
return { value : current . toFixed ( 1 ) , trend} ;
88
88
} ;
89
+
90
+ /**
91
+ * Format trend value for display
92
+ */
93
+ export const formatTrendValue = ( val : number ) : string => {
94
+ if ( val >= 1 ) {
95
+ return `+${ val . toFixed ( 0 ) } ` ;
96
+ } else if ( val > 0 ) {
97
+ return `+${ val . toFixed ( 1 ) } ` ;
98
+ } else {
99
+ return val . toFixed ( 1 ) ;
100
+ }
101
+ } ;
You can’t perform that action at this time.
0 commit comments