diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/index.test.js.snap b/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/index.test.js.snap index 69dca5cfdd..24125dbaa7 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/index.test.js.snap +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/index.test.js.snap @@ -21,6 +21,7 @@ exports[` ATM snapshot test 1`] = ` placeholder="Select A Service" props={ Object { + "className": "select-a-service-input", "clearable": false, "disabled": null, "options": Array [ @@ -34,10 +35,6 @@ exports[` ATM snapshot test 1`] = ` }, ], "required": true, - "style": Object { - "fontSize": 14, - "width": "100%", - }, "value": "s1", } } @@ -53,7 +50,7 @@ exports[` ATM snapshot test 1`] = `

- Aggregation of all " + 95th percentile aggregation of all " s1 " metrics in selected timeframe. @@ -75,6 +72,7 @@ exports[` ATM snapshot test 1`] = ` placeholder="Select A Timeframe" props={ Object { + "className": "select-a-timeframe-input", "clearable": false, "defaultValue": Object { "label": "Last Hour", @@ -108,10 +106,6 @@ exports[` ATM snapshot test 1`] = ` }, ], "required": true, - "style": Object { - "fontSize": 14, - "width": 128, - }, "value": 3600000, } } @@ -176,7 +170,7 @@ exports[` ATM snapshot test 1`] = ` }, ] } - name="Latency" + name="Latency, ms" showHorizontalLines={true} showLegend={true} width={300} @@ -207,7 +201,7 @@ exports[` ATM snapshot test 1`] = ` "serviceName": "cartservice", } } - name="Error rate %" + name="Error rate, %" width={300} yDomain={ Array [ @@ -242,7 +236,7 @@ exports[` ATM snapshot test 1`] = ` "serviceName": "cartservice", } } - name="Requests" + name="Requests rate, req/s" showHorizontalLines={true} width={300} /> @@ -261,44 +255,29 @@ exports[` ATM snapshot test 1`] = `

- Operations under + 95th percentile operations metrics under s1

- Over the last - hour + Over the + last hour diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/serviceGraph.test.js.snap b/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/serviceGraph.test.js.snap index fa32b3b088..567b2a6932 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/serviceGraph.test.js.snap +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/__snapshots__/serviceGraph.test.js.snap @@ -161,7 +161,7 @@ exports[` Base graph should be displayed 1`] = `
@@ -275,7 +275,7 @@ exports[` Base graph with custom color should be displayed 1`] = `
@@ -393,7 +393,7 @@ exports[` Base graph with horizontal lines should be displayed 1`]
@@ -507,7 +507,7 @@ exports[` Base graph with legends should be displayed 1`] = `
@@ -642,7 +642,7 @@ exports[` Crosshair map test 1`] = `
diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.css b/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.css index 476f83cc54..f04b2eba0c 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.css +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.css @@ -33,6 +33,8 @@ limitations under the License. .timeframe-selector { display: inline-flex; justify-content: flex-end; + position: absolute; + bottom: 14px; } .operation-table-block { @@ -45,3 +47,28 @@ limitations under the License. font-size: 18; font-weight: 700; } + +.select-a-service-input { + font-size: 14px; + width: 100%; +} + +.select-a-timeframe-input { + font-size: 14px; + width: 128px; +} + +.over-the-last { + font-size: 14px; + font-weight: 400; +} + +.select-operation-column { + display: inline-flex; + justify-content: flex-end; +} + +.select-operation-input { + font-size: 14px; + width: 218px; +} diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.test.js b/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.test.js index dd33ecb446..1811b8dd42 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.test.js +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.test.js @@ -18,6 +18,7 @@ import { MonitoringATMServicesViewImpl as MonitoringATMServicesView, mapStateToProps, mapDispatchToProps, + getLoopbackInterval, } from '.'; import LoadingIndicator from '../../common/LoadingIndicator'; import MonitoringATMEmptyState from '../EmptyState'; @@ -74,6 +75,7 @@ describe('', () => { expect(mockFetchAggregatedServiceMetrics).not.toHaveBeenCalled(); wrapper.setProps({ services: ['s1', 's2'], + selectedService: 's1', metrics: { ...originInitialState, serviceMetrics, @@ -160,3 +162,17 @@ describe('mapDispatchToProps()', () => { }); }); }); + +describe('getLoopbackInterval()', () => { + it('undefined value', () => { + expect(getLoopbackInterval()).toBe(''); + }); + + it('timeframe NOT exists', () => { + expect(getLoopbackInterval(111)).toBe(''); + }); + + it('timeframe exists', () => { + expect(getLoopbackInterval(48 * 3600000)).toBe('last 2 days'); + }); +}); diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.tsx b/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.tsx index 9d379d4ae4..a6c76a3554 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.tsx +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/index.tsx @@ -62,6 +62,26 @@ const AdaptedVirtualSelect = reduxFormFieldAdapter({ }); const serviceFormSelector = formValueSelector('serviceForm'); +const oneHourInMilliSeconds = 3600000; +const timeFrameOptions = [ + { label: 'Last Hour', value: oneHourInMilliSeconds }, + { label: 'Last 2 hour', value: 2 * oneHourInMilliSeconds }, + { label: 'Last 6 hour', value: 6 * oneHourInMilliSeconds }, + { label: 'Last 12 hour', value: 12 * oneHourInMilliSeconds }, + { label: 'Last 24 hours', value: 24 * oneHourInMilliSeconds }, + { label: 'Last 2 days', value: 48 * oneHourInMilliSeconds }, +]; + +// export for tests +export const getLoopbackInterval = (interval: number) => { + if (!interval) return ''; + + const timeFrameObj = timeFrameOptions.find(t => t.value === interval); + + if (timeFrameObj === undefined) return ''; + + return timeFrameObj.label.toLowerCase(); +}; // export for tests export class MonitoringATMServicesViewImpl extends React.PureComponent { @@ -88,15 +108,11 @@ export class MonitoringATMServicesViewImpl extends React.PureComponent; } - const timeframeInHours = selectedTimeFrame / 3600000; - const timePeriod = timeframeInHours <= 1 ? '' : timeframeInHours.toFixed(0); - this.isReady = true; return ( @@ -175,7 +188,7 @@ export class MonitoringATMServicesViewImpl extends React.PureComponent

- Aggregation of all "{this.getSelectedService()}" metrics in selected timeframe.{' '} + 95th percentile aggregation of all "{this.getSelectedService()}" metrics in selected + timeframe.{' '} @@ -235,7 +242,7 @@ export class MonitoringATMServicesViewImpl extends React.PureComponent -

Operations under {this.getSelectedService()}

{' '} - - Over the last {timePeriod} hour{timePeriod === '' ? '' : 's'} - +

+ 95th percentile operations metrics under {this.getSelectedService()} +

{' '} + Over the {getLoopbackInterval(selectedTimeFrame)} - + ) => { @@ -330,7 +332,7 @@ export function mapStateToProps(state: ReduxState): TReduxProps { metrics, selectedService: serviceFormSelector(state, 'service') || store.get('lastAtmSearchService'), selectedTimeFrame: - serviceFormSelector(state, 'timeframe') || store.get('lastAtmSearchTimeframe') || 3600000, + serviceFormSelector(state, 'timeframe') || store.get('lastAtmSearchTimeframe') || oneHourInMilliSeconds, }; } diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap b/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap index 607d193867..aa19d5f153 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap @@ -83,6 +83,7 @@ exports[` Table rendered successfully 1`] = ` autoAdjustOverflow={true} mouseEnterDelay={0.1} mouseLeaveDelay={0.1} + overlayClassName="impact-tooltip" placement="top" prefixCls="ant-tooltip" title="The result of multiplying avg. duration and requests per minute, showing the most used and slowest endpoints" diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.css b/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.css index e62bf535fe..574f19d95d 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.css +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.css @@ -75,6 +75,10 @@ td.header-item { display: flex; } +.impact-tooltip .ant-tooltip-inner { + word-break: keep-all; +} + .view-trace-button { width: 200px; height: 30px; diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.tsx b/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.tsx index 2c2d99006c..b325a5312c 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.tsx +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/operationDetailsTable/index.tsx @@ -127,6 +127,7 @@ export class OperationTableDetails extends React.PureComponent { Impact   diff --git a/packages/jaeger-ui/src/components/Monitoring/ServicesView/serviceGraph.tsx b/packages/jaeger-ui/src/components/Monitoring/ServicesView/serviceGraph.tsx index 8f8de53d04..5ec386c294 100644 --- a/packages/jaeger-ui/src/components/Monitoring/ServicesView/serviceGraph.tsx +++ b/packages/jaeger-ui/src/components/Monitoring/ServicesView/serviceGraph.tsx @@ -62,7 +62,7 @@ export const tickFormat = (v: number) => { export class ServiceGraphImpl extends React.PureComponent { height = 242; colors: string[] = ['#DCA3D2', '#EA9977', '#869ADD']; - state = { + state: { crosshairValues: TCrossHairValues[] } = { crosshairValues: [], }; @@ -165,7 +165,11 @@ export class ServiceGraphImpl extends React.PureComponent { {this.renderLines()} -
+
+ {this.state.crosshairValues[0] && + `${new Date(this.state.crosshairValues[0].x).toLocaleDateString()} ${new Date( + this.state.crosshairValues[0].x + ).toLocaleTimeString()}`} {this.state.crosshairValues.map((d: TCrossHairValues) => showLegend ? (
@@ -181,10 +185,12 @@ export class ServiceGraphImpl extends React.PureComponent { ({ - color: this.colors[idx], - title: `${d.quantile * 100}th`, - }))} + items={this.getData() + .map((d: ServiceMetricsObject, idx: number) => ({ + color: this.colors[idx], + title: `${d.quantile * 100}th`, + })) + .reverse()} /> ) : null}