diff --git a/src/components/TracePage/TracePageTimeline.test.js b/src/components/TracePage/TracePageTimeline.test.js
index 91e6801ed6..fedb4c0d91 100644
--- a/src/components/TracePage/TracePageTimeline.test.js
+++ b/src/components/TracePage/TracePageTimeline.test.js
@@ -29,10 +29,8 @@ import TimelineScrubber from './TimelineScrubber';
import traceGenerator from '../../../src/demo/trace-generators';
const listeners = {};
-const addEventListener = sinon.spy((name, fn) =>
- Object.assign(listeners, { [name]: fn }));
-const removeEventListener = sinon.spy((name, fn) =>
- Object.assign(listeners, { [name]: fn }));
+const addEventListener = sinon.spy((name, fn) => Object.assign(listeners, { [name]: fn }));
+const removeEventListener = sinon.spy((name, fn) => Object.assign(listeners, { [name]: fn }));
const clearListeners = () =>
Object.keys(listeners).forEach(key => {
delete listeners[key];
@@ -85,28 +83,19 @@ const defaultOptions = {
};
it('
, defaultOptions);
expect(wrapper.find(SpanGraph).length).toBe(1);
});
it('
, defaultOptions);
expect(wrapper.find(SpanGraphTickHeader).length).toBe(1);
});
it('
should render a filtering box if leftBound exists', ()
expect(
wrapper.containsMatchingElement(
-
should render a filtering box if rightBound exists', (
expect(
wrapper.containsMatchingElement(
-
should render handles for the timeRangeFilter', () => {
- const wrapper = shallow(
-
, defaultOptions);
expect(
wrapper.containsMatchingElement(
@@ -174,39 +148,25 @@ it('
should call startDragging for the leftBound handle', () => {
- const wrapper = shallow(
-
, defaultOptions);
const event = { clientX: 50 };
sinon.stub(wrapper.instance(), 'startDragging');
- wrapper.find('#trace-page-timeline__left-bound-handle').prop('onMouseDown')(
- event
- );
+ wrapper.find('#trace-page-timeline__left-bound-handle').prop('onMouseDown')(event);
- expect(
- wrapper.instance().startDragging.calledWith('leftBound', event)
- ).toBeTruthy();
+ expect(wrapper.instance().startDragging.calledWith('leftBound', event)).toBeTruthy();
});
it('
should call startDragging for the rightBound handle', () => {
- const wrapper = shallow(
-
, defaultOptions);
const event = { clientX: 50 };
sinon.stub(wrapper.instance(), 'startDragging');
- wrapper.find('#trace-page-timeline__right-bound-handle').prop('onMouseDown')(
- event
- );
+ wrapper.find('#trace-page-timeline__right-bound-handle').prop('onMouseDown')(event);
- expect(
- wrapper.instance().startDragging.calledWith('rightBound', event)
- ).toBeTruthy();
+ expect(wrapper.instance().startDragging.calledWith('rightBound', event)).toBeTruthy();
});
it('
should render without handles if no filtering', () => {
@@ -230,10 +190,7 @@ it('
should timeline-sort the trace before rendering', () =
defaultProps.trace.spans[1],
];
- const wrapper = shallow(
-
, defaultOptions);
const spanGraph = wrapper.find(SpanGraph).first();
expect(spanGraph.prop('spans')).toEqual(sortedTraceSpans);
@@ -250,10 +207,7 @@ it('
should create ticks and pass them to components', () =
{ timestamp: timestamp + 50000, width: 2 },
];
- const wrapper = shallow(
-
, defaultOptions);
const spanGraph = wrapper.find(SpanGraph).first();
const spanGraphTickHeader = wrapper.find(SpanGraphTickHeader).first();
@@ -262,40 +216,28 @@ it('
, defaultOptions);
const spanGraph = wrapper.find(SpanGraph).first();
expect(spanGraph.prop('rowHeight')).toBe(50 / 3);
});
it('
should pass the props through to SpanGraph', () => {
- const wrapper = shallow(
-
, defaultOptions);
const spanGraph = wrapper.find(SpanGraph).first();
expect(spanGraph.prop('rowPadding')).toBe(0);
});
it('
should pass the props through to SpanGraphTickHeader', () => {
- const wrapper = shallow(
-
, defaultOptions);
const spanGraphTickHeader = wrapper.find(SpanGraphTickHeader).first();
expect(spanGraphTickHeader.prop('trace')).toEqual(defaultProps.trace);
});
it('TracePageTimeline.shouldComponentUpdate should return true for new timeRange', () => {
- const wrapper = shallow(
-
, defaultOptions);
expect(
wrapper.instance().shouldComponentUpdate(defaultProps, wrapper.state(), {
@@ -305,10 +247,7 @@ it('TracePageTimeline.shouldComponentUpdate should return true for new timeRange
});
it('TracePageTimeline.shouldComponentUpdate should return true for new traces', () => {
- const wrapper = shallow(
-
, defaultOptions);
expect(
wrapper
@@ -322,10 +261,7 @@ it('TracePageTimeline.shouldComponentUpdate should return true for new traces',
});
it('TracePageTimeline.shouldComponentUpdate should return true for currentlyDragging', () => {
- const wrapper = shallow(
-
, defaultOptions);
expect(
wrapper.instance().shouldComponentUpdate(
@@ -340,19 +276,10 @@ it('TracePageTimeline.shouldComponentUpdate should return true for currentlyDrag
});
it('TracePageTimeline.shouldComponentUpdate should return false otherwise', () => {
- const wrapper = shallow(
-
, defaultOptions);
expect(
- wrapper
- .instance()
- .shouldComponentUpdate(
- defaultProps,
- wrapper.state(),
- defaultOptions.context
- )
+ wrapper.instance().shouldComponentUpdate(defaultProps, wrapper.state(), defaultOptions.context)
).toBe(false);
});
@@ -376,10 +303,7 @@ it('TracePageTimeline.onMouseMove should do nothing if currentlyDragging is fals
});
it('TracePageTimeline.onMouseMove should store the clientX on the state', () => {
- const wrapper = shallow(
-
, defaultOptions);
wrapper.instance().svg = { clientWidth: 100 };
wrapper.setState({ currentlyDragging: 'leftBound' });
@@ -404,9 +328,7 @@ it('TracePageTimeline.onMouseMove should update the timeRangeFilter for the left
wrapper.instance().onMouseMove({ clientX: 45 });
- expect(
- updateTimeRangeFilter.calledWith(timestamp + 22500, timestamp + 50000)
- ).toBeTruthy();
+ expect(updateTimeRangeFilter.calledWith(timestamp + 22500, timestamp + 50000)).toBeTruthy();
});
it('TracePageTimeline.onMouseMove should update the timeRangeFilter for the right handle', () => {
@@ -424,16 +346,11 @@ it('TracePageTimeline.onMouseMove should update the timeRangeFilter for the righ
wrapper.instance().onMouseMove({ clientX: 45 });
- expect(
- updateTimeRangeFilter.calledWith(timestamp, timestamp + 22500)
- ).toBeTruthy();
+ expect(updateTimeRangeFilter.calledWith(timestamp, timestamp + 22500)).toBeTruthy();
});
it('TracePageTimeline.startDragging should store the boundName and the prevX in state', () => {
- const wrapper = shallow(
-
, defaultOptions);
wrapper.instance().startDragging('leftBound', { clientX: 100 });
@@ -442,96 +359,61 @@ it('TracePageTimeline.startDragging should store the boundName and the prevX in
});
// TODO: Need to figure out how to mock to window events.
-it.skip(
- 'TracePageTimeline.startDragging should bind event listeners to the window',
- () => {
- const wrapper = shallow(
-
,
- defaultOptions
- );
-
- clearListeners();
-
- wrapper.instance().startDragging('leftBound', { clientX: 100 });
-
- expect(
- addEventListener.calledWith('mousemove', sinon.match.func)
- ).toBeTruthy();
- expect(
- addEventListener.calledWith('mouseup', sinon.match.func)
- ).toBeTruthy();
- }
-);
-
-it.skip(
- 'TracePageTimeline.startDragging should call onMouseMove on the window',
- () => {
- const wrapper = shallow(
-
,
- defaultOptions
- );
-
- clearListeners();
-
- wrapper.instance().startDragging('leftBound', { clientX: 100 });
- sinon.stub(wrapper.instance(), 'onMouseMove');
-
- const event = { clientX: 99 };
- listeners.mousemove(event);
-
- expect(wrapper.instance().onMouseMove.calledWith(event)).toBeTruthy();
- }
-);
-
-it.skip(
- 'TracePageTimeline.startDragging mouseup should call stopDragging',
- () => {
- const wrapper = shallow(
-
,
- defaultOptions
- );
-
- clearListeners();
-
- wrapper.instance().startDragging('leftBound', { clientX: 100 });
- sinon.stub(wrapper.instance(), 'stopDragging');
-
- const event = { clientX: 99 };
- listeners.mouseup(event);
-
- expect(wrapper.instance().stopDragging.called).toBeTruthy();
- }
-);
-
-it.skip(
- 'TracePageTimeline.startDragging mouseup should stop listening to the events',
- () => {
- const wrapper = shallow(
-
,
- defaultOptions
- );
-
- clearListeners();
-
- wrapper.instance().startDragging('leftBound', { clientX: 100 });
-
- const event = { clientX: 99 };
- listeners.mouseup(event);
-
- expect(
- removeEventListener.calledWith('mousemove', sinon.match.func)
- ).toBeTruthy();
- expect(
- removeEventListener.calledWith('mouseup', sinon.match.func)
- ).toBeTruthy();
- }
-);
+it.skip('TracePageTimeline.startDragging should bind event listeners to the window', () => {
+ const wrapper = shallow(
, defaultOptions);
+
+ clearListeners();
+
+ wrapper.instance().startDragging('leftBound', { clientX: 100 });
+
+ expect(addEventListener.calledWith('mousemove', sinon.match.func)).toBeTruthy();
+ expect(addEventListener.calledWith('mouseup', sinon.match.func)).toBeTruthy();
+});
+
+it.skip('TracePageTimeline.startDragging should call onMouseMove on the window', () => {
+ const wrapper = shallow(
, defaultOptions);
+
+ clearListeners();
+
+ wrapper.instance().startDragging('leftBound', { clientX: 100 });
+ sinon.stub(wrapper.instance(), 'onMouseMove');
+
+ const event = { clientX: 99 };
+ listeners.mousemove(event);
+
+ expect(wrapper.instance().onMouseMove.calledWith(event)).toBeTruthy();
+});
+
+it.skip('TracePageTimeline.startDragging mouseup should call stopDragging', () => {
+ const wrapper = shallow(
, defaultOptions);
+
+ clearListeners();
+
+ wrapper.instance().startDragging('leftBound', { clientX: 100 });
+ sinon.stub(wrapper.instance(), 'stopDragging');
+
+ const event = { clientX: 99 };
+ listeners.mouseup(event);
+
+ expect(wrapper.instance().stopDragging.called).toBeTruthy();
+});
+
+it.skip('TracePageTimeline.startDragging mouseup should stop listening to the events', () => {
+ const wrapper = shallow(
, defaultOptions);
+
+ clearListeners();
+
+ wrapper.instance().startDragging('leftBound', { clientX: 100 });
+
+ const event = { clientX: 99 };
+ listeners.mouseup(event);
+
+ expect(removeEventListener.calledWith('mousemove', sinon.match.func)).toBeTruthy();
+ expect(removeEventListener.calledWith('mouseup', sinon.match.func)).toBeTruthy();
+});
it('TracePageTimeline.stopDragging should clear currentlyDragging and prevX', () => {
- const wrapper = shallow(
-
, defaultOptions);
wrapper.instance().stopDragging();
diff --git a/src/components/TracePage/TraceTimelineViewer/SpanBreakdownGraph.js b/src/components/TracePage/TraceTimelineViewer/SpanBreakdownGraph.js
deleted file mode 100644
index f5e5e5a643..0000000000
--- a/src/components/TracePage/TraceTimelineViewer/SpanBreakdownGraph.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2017 Uber Technologies, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-import PropTypes from 'prop-types';
-import React from 'react';
-import SpanGraphTick from '../../SpanGraph/SpanGraphTick';
-import logPropTypes from '../../../propTypes/log';
-
-export default function SpanBreakdownBar({ span }) {
- const padding = 3;
- const fontSize = 11;
- return (
-
- );
-}
-
-SpanBreakdownBar.propTypes = {
- span: PropTypes.shape({
- duration: PropTypes.number,
- timestamp: PropTypes.number,
- logs: PropTypes.arrayOf(logPropTypes),
- }),
-};
diff --git a/src/components/TracePage/TraceTimelineViewer/SpanDetail.js b/src/components/TracePage/TraceTimelineViewer/SpanDetail.js
index c397df6ce6..8ed2a190aa 100644
--- a/src/components/TracePage/TraceTimelineViewer/SpanDetail.js
+++ b/src/components/TracePage/TraceTimelineViewer/SpanDetail.js
@@ -29,12 +29,7 @@ import { formatDuration } from './utils';
const collapseEnhancer = withState('open', 'onToggleOpen', false);
function CollapsePanel(props) {
- const {
- header,
- onToggleOpen,
- children,
- open,
- } = props;
+ const { header, onToggleOpen, children, open } = props;
return (
{open &&
@@ -95,10 +92,7 @@ function ExpandableDataTable(props) {
}
return (
-
+ |
{row.key}
|
@@ -145,16 +139,14 @@ function Logs({ logs, traceStartTime, open, onToggleOpen }) {
{open &&
- {_.sortBy(logs, 'timestamp').map(log => (
+ {_.sortBy(logs, 'timestamp').map(log =>
- ))}
+ )}
-
- **Log timestamps are relative to the start time of the full trace.
-
+ **Log timestamps are relative to the start time of the full trace.
}
@@ -180,19 +172,27 @@ export default function SpanDetail(props) {
return (
- {span.operationName}
+
+ {span.operationName}
+
Service:
- {span.process.serviceName}
+
+ {span.process.serviceName}
+
Duration:
- {formatDuration(span.duration)}
+
+ {formatDuration(span.duration)}
+
Start Time:
- {formatDuration(span.relativeStartTime)}
+
+ {formatDuration(span.relativeStartTime)}
+
@@ -202,10 +202,7 @@ export default function SpanDetail(props) {
{span.process &&
span.process.tags &&
- }
+ }
{span.logs &&
span.logs.length > 0 &&
@@ -215,7 +212,9 @@ export default function SpanDetail(props) {
spanID |
- {span.spanID} |
+
+ {span.spanID}
+ |
diff --git a/src/components/TracePage/TraceTimelineViewer/index.js b/src/components/TracePage/TraceTimelineViewer/index.js
index 20c6dccd2c..ecec067886 100644
--- a/src/components/TracePage/TraceTimelineViewer/index.js
+++ b/src/components/TracePage/TraceTimelineViewer/index.js
@@ -21,13 +21,7 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import _ from 'lodash';
-import {
- onlyUpdateForKeys,
- compose,
- withState,
- withProps,
- pure,
-} from 'recompose';
+import { onlyUpdateForKeys, compose, withState, withProps, pure } from 'recompose';
import * as d3 from 'd3-scale';
import { filterSpansForText } from '../../../selectors/span';
import './grid.css';
@@ -50,8 +44,7 @@ import SpanDetail from './SpanDetail';
// TODO: Add unit tests
// TODO: unify transforms and utils
-const ensurePercentIsBetween0And100 = percent =>
- ensureWithinRange([0, 100], percent);
+const ensurePercentIsBetween0And100 = percent => ensureWithinRange([0, 100], percent);
/**
* Components!
@@ -140,7 +133,7 @@ function Ticks(props) {
const margin = 5;
return (
- {ticks.map(tick => (
+ {ticks.map(tick =>
- ))}
+ )}
);
}
@@ -258,189 +251,152 @@ function TraceView(props) {
}
let collapseBelow = null;
- const renderSpansRows = trace.spans.reduce(
- (arr, span, i) => {
- const { spanID } = span;
- const showSpanDetails = selectedSpanIDs.has(spanID);
- const spanHasChildren = span.hasChildren;
- const spanIsCollapsed = collapsedSpanIDs.has(spanID);
- const spanColor = colorGenerator.getColorByKey(span.process.serviceName);
+ const renderSpansRows = trace.spans.reduce((arr, span, i) => {
+ const { spanID } = span;
+ const showSpanDetails = selectedSpanIDs.has(spanID);
+ const spanHasChildren = span.hasChildren;
+ const spanIsCollapsed = collapsedSpanIDs.has(spanID);
+ const spanColor = colorGenerator.getColorByKey(span.process.serviceName);
- let filterOutSpan = false;
- if (filteredSpansIDs) {
- filterOutSpan = !filteredSpansIDs.has(spanID);
- }
+ let filterOutSpan = false;
+ if (filteredSpansIDs) {
+ filterOutSpan = !filteredSpansIDs.has(spanID);
+ }
- // Collapse logic
- // TODO: Investigate if this should be moved out to statefull component.
- let hidden = false;
- if (collapseBelow) {
- if (span.depth >= collapseBelow) {
- hidden = true;
- } else {
- collapseBelow = null;
- }
- }
- if (spanIsCollapsed && !hidden) {
- collapseBelow = span.depth + 1;
- }
- if (hidden) {
- return arr;
+ // Collapse logic
+ // TODO: Investigate if this should be moved out to statefull component.
+ let hidden = false;
+ if (collapseBelow) {
+ if (span.depth >= collapseBelow) {
+ hidden = true;
+ } else {
+ collapseBelow = null;
}
+ }
+ if (spanIsCollapsed && !hidden) {
+ collapseBelow = span.depth + 1;
+ }
+ if (hidden) {
+ return arr;
+ }
- // Compute span position with given zoom.
- const { xStart: startPercent, xEnd: endPercent } = calculateSpanPosition({
+ // Compute span position with given zoom.
+ const { xStart: startPercent, xEnd: endPercent } = calculateSpanPosition({
+ traceStartTime: trace.startTime,
+ traceEndTime: trace.endTime,
+ spanStart: span.startTime,
+ spanEnd: span.startTime + span.duration,
+ xStart: zoomStart,
+ xEnd: zoomEnd,
+ });
+
+ // Check for direct child "server" span if the span is a "client" span.
+ // TODO: Can probably optimize this a bit more so it does not do it
+ // on render.
+ const childServerSpan = findServerChildSpan(trace.spans.slice(i));
+ let interval;
+ if (childServerSpan && spanIsCollapsed) {
+ const childSpanPosition = calculateSpanPosition({
traceStartTime: trace.startTime,
traceEndTime: trace.endTime,
- spanStart: span.startTime,
- spanEnd: span.startTime + span.duration,
+ spanStart: childServerSpan.startTime,
+ spanEnd: childServerSpan.startTime + childServerSpan.duration,
xStart: zoomStart,
xEnd: zoomEnd,
});
+ const x = d3.scaleLinear().domain([startPercent, endPercent]).range([0, 100]);
+ interval = {
+ color: colorGenerator.getColorByKey(childServerSpan.process.serviceName),
+ startPercent: x(childSpanPosition.xStart),
+ endPercent: x(childSpanPosition.xEnd),
+ };
+ }
- // Check for direct child "server" span if the span is a "client" span.
- // TODO: Can probably optimize this a bit more so it does not do it
- // on render.
- const childServerSpan = findServerChildSpan(trace.spans.slice(i));
- let interval;
- if (childServerSpan && spanIsCollapsed) {
- const childSpanPosition = calculateSpanPosition({
- traceStartTime: trace.startTime,
- traceEndTime: trace.endTime,
- spanStart: childServerSpan.startTime,
- spanEnd: childServerSpan.startTime + childServerSpan.duration,
- xStart: zoomStart,
- xEnd: zoomEnd,
- });
- const x = d3
- .scaleLinear()
- .domain([startPercent, endPercent])
- .range([0, 100]);
- interval = {
- color: colorGenerator.getColorByKey(
- childServerSpan.process.serviceName
- ),
- startPercent: x(childSpanPosition.xStart),
- endPercent: x(childSpanPosition.xEnd),
- };
- }
-
- const showErrorIcon = isErrorSpan(span) ||
- (spanIsCollapsed && spanContainsErredSpan(trace.spans, i));
- const backgroundColor = showSpanDetails ? 'whitesmoke' : null;
- arr.push(
-
-
-
+
+ onSpanClick(spanID)}>
+ ({ percent }))} />
+
- );
- }
- return arr;
- },
- []
- );
+
+
+ );
+ if (showSpanDetails) {
+ arr.push( );
+ }
+ return arr;
+ }, []);
return (
@@ -452,9 +408,7 @@ function TraceView(props) {
({
percent: tickPercent,
- label: tickPercent !== 0
- ? formatDuration(getDuationAtTickPercent(tickPercent))
- : '',
+ label: tickPercent !== 0 ? formatDuration(getDuationAtTickPercent(tickPercent)) : '',
position: tickPercent === 100 ? 'left' : 'right',
}))}
/>
@@ -528,10 +482,7 @@ export default class TraceTimelineViewer extends Component {
}).forEach(span => filteredSpansIDs.set(span.spanID, true));
}
const { startTime, endTime } = trace;
- const zoom = convertTimeRangeToPercent(timeRangeFilter, [
- startTime,
- endTime,
- ]);
+ const zoom = convertTimeRangeToPercent(timeRangeFilter, [startTime, endTime]);
return (
50,100
* 100ms, 200ms => 0,100
*/
-export function convertTimeRangeToPercent(
- [startTime, endTime],
- [traceStartTime, traceEndTime]
-) {
+export function convertTimeRangeToPercent([startTime, endTime], [traceStartTime, traceEndTime]) {
if (startTime === null || endTime === null) {
return [0, 100];
}
- const getPercent = d3
- .scaleLinear()
- .domain([traceStartTime, traceEndTime])
- .range([0, 100]);
+ const getPercent = d3.scaleLinear().domain([traceStartTime, traceEndTime]).range([0, 100]);
return [getPercent(startTime), getPercent(endTime)];
}
diff --git a/src/components/TracePage/TraceTimelineViewer/utils.test.js b/src/components/TracePage/TraceTimelineViewer/utils.test.js
index 1a00fd33cb..fa6739ef86 100644
--- a/src/components/TracePage/TraceTimelineViewer/utils.test.js
+++ b/src/components/TracePage/TraceTimelineViewer/utils.test.js
@@ -55,12 +55,8 @@ it('calculateSpanPosition() maps a sub-range to percents with a zoom applied', (
it('calculateTimeAtPositon() converts a percent to a value in [0, duration]', () => {
const traceDuration = 1000;
expect(calculateTimeAtPositon({ position: 0, traceDuration })).toBe(0);
- expect(calculateTimeAtPositon({ position: 100, traceDuration })).toBe(
- traceDuration
- );
- expect(calculateTimeAtPositon({ position: 50, traceDuration })).toBe(
- 0.5 * traceDuration
- );
+ expect(calculateTimeAtPositon({ position: 100, traceDuration })).toBe(traceDuration);
+ expect(calculateTimeAtPositon({ position: 50, traceDuration })).toBe(0.5 * traceDuration);
});
it('convertTimeRangeToPercent() converts a sub-range to percent start and end values', () => {
@@ -109,8 +105,7 @@ spanTypeTestCases.forEach(testCase => {
it('spanContainsErredSpan() is true only when a descendant has an error tag', () => {
const errorTag = { key: 'error', type: 'bool', value: true };
- const getTags = withError =>
- withError ? traceGenerator.tags().concat(errorTag) : traceGenerator.tags();
+ const getTags = withError => (withError ? traceGenerator.tags().concat(errorTag) : traceGenerator.tags());
// Using a string to generate the test spans. Each line results in a span. The
// left number indicates whether or not the generated span has a descendant
diff --git a/src/components/TracePage/index.js b/src/components/TracePage/index.js
index caee7222b7..1c2f77c8fa 100644
--- a/src/components/TracePage/index.js
+++ b/src/components/TracePage/index.js
@@ -89,10 +89,7 @@ export default class TracePage extends Component {
return;
}
- if (
- !(trace instanceof Error) &&
- (!prevTrace || getTraceId(prevTrace) !== getTraceId(trace))
- ) {
+ if (!(trace instanceof Error) && (!prevTrace || getTraceId(prevTrace) !== getTraceId(trace))) {
this.setDefaultTimeRange();
}
}
@@ -105,10 +102,7 @@ export default class TracePage extends Component {
return;
}
- this.updateTimeRangeFilter(
- getTraceTimestamp(trace),
- getTraceEndTimestamp(trace)
- );
+ this.updateTimeRangeFilter(getTraceTimestamp(trace), getTraceEndTimestamp(trace));
}
updateTextFilter(textFilter) {
@@ -135,10 +129,7 @@ export default class TracePage extends Component {
}
render() {
- const {
- id,
- trace,
- } = this.props;
+ const { id, trace } = this.props;
const { slimView } = this.state;
if (!trace) {
@@ -196,6 +187,4 @@ function mapDispatchToProps(dispatch) {
return { fetchTrace };
}
-export const ConnectedTracePage = connect(mapStateToProps, mapDispatchToProps)(
- TracePage
-);
+export const ConnectedTracePage = connect(mapStateToProps, mapDispatchToProps)(TracePage);
diff --git a/src/components/TracePage/index.test.js b/src/components/TracePage/index.test.js
index 391b4f7cd4..8806da109b 100644
--- a/src/components/TracePage/index.test.js
+++ b/src/components/TracePage/index.test.js
@@ -23,8 +23,7 @@ import sinon from 'sinon';
import { shallow } from 'enzyme';
import TracePage from '../../../src/components/TracePage';
import TracePageHeader from '../../../src/components/TracePage/TracePageHeader';
-import TracePageTimeline
- from '../../../src/components/TracePage/TracePageTimeline';
+import TracePageTimeline from '../../../src/components/TracePage/TracePageTimeline';
const traceID = 'trace-id';
const timestamp = new Date().getTime() * 1000;
@@ -76,9 +75,7 @@ it(' should render a with the trace', () => {
it(' should render a with the trace', () => {
const wrapper = shallow();
- expect(
- wrapper.contains()
- ).toBeTruthy();
+ expect(wrapper.contains()).toBeTruthy();
});
it(' should render an empty page if no trace', () => {
@@ -90,9 +87,7 @@ it(' should render an empty page if no trace', () => {
// can't do mount tests in standard tape run.
it('TracePage should fetch the trace if necessary', () => {
const fetchTrace = sinon.spy();
- const wrapper = shallow(
-
- );
+ const wrapper = shallow();
wrapper.instance().componentDidMount();
@@ -102,9 +97,7 @@ it('TracePage should fetch the trace if necessary', () => {
it('TracePage should not fetch the trace if already present', () => {
const fetchTrace = sinon.spy();
- const wrapper = shallow(
-
- );
+ const wrapper = shallow();
wrapper.instance().componentDidMount();
diff --git a/src/demo/dependency-generators.js b/src/demo/dependency-generators.js
index ba7d7bd806..8272f18ba7 100644
--- a/src/demo/dependency-generators.js
+++ b/src/demo/dependency-generators.js
@@ -33,13 +33,11 @@ export default chance.mixin({
return chance.city();
},
- link(
- {
- parent = chance.city(),
- child = chance.city(),
- callCount = chance.integer({ min: 1, max: 250000000 }),
- }
- ) {
+ link({
+ parent = chance.city(),
+ child = chance.city(),
+ callCount = chance.integer({ min: 1, max: 250000000 }),
+ }) {
return { parent, child, callCount };
},
diff --git a/src/demo/jaeger-mock.js b/src/demo/jaeger-mock.js
index 416f5a4a8a..c831fad817 100644
--- a/src/demo/jaeger-mock.js
+++ b/src/demo/jaeger-mock.js
@@ -20,10 +20,7 @@
import Chance from 'chance';
-import traceGenerator, {
- SERVICE_LIST,
- OPERATIONS_LIST,
-} from './trace-generators';
+import traceGenerator, { SERVICE_LIST, OPERATIONS_LIST } from './trace-generators';
import dependencyGenerator from './dependency-generators';
import { getTraceId } from '../selectors/trace';
@@ -31,23 +28,16 @@ const chance = new Chance();
export const DEPENDENCIES_FIXTURES = dependencyGenerator.dependencies({});
export const TRACE_FIXTURES = traceGenerator.traces({});
-const traceMap = new Map(
- TRACE_FIXTURES.map(trace => [getTraceId(trace), trace])
-);
+const traceMap = new Map(TRACE_FIXTURES.map(trace => [getTraceId(trace), trace]));
function resolveWithData(data) {
- return new Promise(
- resolve => setTimeout(() => resolve({ data })),
- chance.integer({ min: 100, max: 2000 })
- );
+ return new Promise(resolve => setTimeout(() => resolve({ data })), chance.integer({ min: 100, max: 2000 }));
}
function rejectWithErrors(...errors) {
return new Promise((resolve, reject) =>
- setTimeout(
- () => reject({ errors }),
- chance.integer({ min: 100, max: 2000 })
- ));
+ setTimeout(() => reject({ errors }), chance.integer({ min: 100, max: 2000 }))
+ );
}
export default {
diff --git a/src/demo/trace-generators.js b/src/demo/trace-generators.js
index 5026450fa9..a998687028 100644
--- a/src/demo/trace-generators.js
+++ b/src/demo/trace-generators.js
@@ -24,14 +24,7 @@ import { getSpanId } from '../selectors/span';
const chance = new Chance();
-export const SERVICE_LIST = [
- 'serviceA',
- 'serviceB',
- 'serviceC',
- 'serviceD',
- 'serviceE',
- 'serviceF',
-];
+export const SERVICE_LIST = ['serviceA', 'serviceB', 'serviceC', 'serviceD', 'serviceE', 'serviceF'];
export const OPERATIONS_LIST = [
'GET',
'PUT',
@@ -58,9 +51,7 @@ function getParentSpanId(span, levels) {
}
});
- return nestingLevel - 1 >= 0
- ? chance.pickone(levels[nestingLevel - 1])
- : null;
+ return nestingLevel - 1 >= 0 ? chance.pickone(levels[nestingLevel - 1]) : null;
}
/* this simulates the hierarchy created by CHILD_OF tags */
@@ -68,8 +59,8 @@ function attachReferences(spans) {
const depth = chance.integer({ min: 1, max: 10 });
let levels = [[getSpanId(spans[0])]];
- const duplicateLevelFilter = currentLevels =>
- spanID => !currentLevels.find(level => level.indexOf(spanID) >= 0);
+ const duplicateLevelFilter = currentLevels => spanID =>
+ !currentLevels.find(level => level.indexOf(spanID) >= 0);
while (levels.length < depth) {
const newLevel = chance
@@ -100,30 +91,23 @@ function attachReferences(spans) {
}
export default chance.mixin({
- trace(
- {
- // long trace
- // very short trace
- // average case
- numberOfSpans = chance.pickone([
- Math.ceil(chance.normal({ mean: 200, dev: 10 })) + 1,
- Math.ceil(chance.integer({ min: 3, max: 10 })),
- Math.ceil(chance.normal({ mean: 45, dev: 15 })) + 1,
- ]),
- numberOfProcesses = chance.integer({ min: 1, max: 10 }),
- }
- ) {
+ trace({
+ // long trace
+ // very short trace
+ // average case
+ numberOfSpans = chance.pickone([
+ Math.ceil(chance.normal({ mean: 200, dev: 10 })) + 1,
+ Math.ceil(chance.integer({ min: 3, max: 10 })),
+ Math.ceil(chance.normal({ mean: 45, dev: 15 })) + 1,
+ ]),
+ numberOfProcesses = chance.integer({ min: 1, max: 10 }),
+ }) {
const traceID = chance.guid();
const duration = chance.integer({ min: 10000, max: 5000000 });
- const timestamp = (new Date().getTime() -
- chance.integer({ min: 0, max: 1000 }) * 1000) *
- 1000;
+ const timestamp = (new Date().getTime() - chance.integer({ min: 0, max: 1000 }) * 1000) * 1000;
const processArray = chance.processes({ numberOfProcesses });
- const processes = processArray.reduce(
- (pMap, p) => ({ ...pMap, [p.processID]: p }),
- {}
- );
+ const processes = processArray.reduce((pMap, p) => ({ ...pMap, [p.processID]: p }), {});
let spans = chance.n(chance.span, numberOfSpans, {
traceID,
@@ -148,22 +132,16 @@ export default chance.mixin({
return {
key: 'http.url',
type: 'String',
- value: `/v2/${chance.pickone([
- 'alpha',
- 'beta',
- 'gamma',
- ])}/${chance.guid()}`,
+ value: `/v2/${chance.pickone(['alpha', 'beta', 'gamma'])}/${chance.guid()}`,
};
},
- span(
- {
- traceID = chance.guid(),
- processes = {},
- traceStartTime = chance.timestamp() * 1000 * 1000,
- traceEndTime = traceStartTime + 100000,
- operations = OPERATIONS_LIST,
- }
- ) {
+ span({
+ traceID = chance.guid(),
+ processes = {},
+ traceStartTime = chance.timestamp() * 1000 * 1000,
+ traceEndTime = traceStartTime + 100000,
+ operations = OPERATIONS_LIST,
+ }) {
const startTime = chance.integer({
min: traceStartTime,
max: traceEndTime,
diff --git a/src/index.js b/src/index.js
index b644b21605..984724f223 100644
--- a/src/index.js
+++ b/src/index.js
@@ -32,9 +32,7 @@ export { SearchTracePage } from './components/SearchTracePage';
export default JaegerUIApp;
const UI_ROOT_ID = 'jaeger-ui-root';
-const history = process.env.REACT_APP_GH_PAGES === 'true'
- ? hashHistory
- : browserHistory;
+const history = process.env.REACT_APP_GH_PAGES === 'true' ? hashHistory : browserHistory;
/* istanbul ignore if */
if (process.env.NODE_ENV === 'development') {
@@ -48,8 +46,5 @@ if (process.env.NODE_ENV === 'development') {
/* istanbul ignore if */
if (document && process.env.NODE_ENV !== 'test') {
- ReactDOM.render(
- ,
- document.getElementById(UI_ROOT_ID)
- );
+ ReactDOM.render(, document.getElementById(UI_ROOT_ID));
}
diff --git a/src/index.test.js b/src/index.test.js
index 02f3d01863..af8157cbd9 100644
--- a/src/index.test.js
+++ b/src/index.test.js
@@ -34,8 +34,6 @@ it('TracePage should be exported as as a named export', () => {
});
it('SearchTracePage should be exported as a named export', () => {
- expect(SearchTracePage).toBe(
- require('../src/components/SearchTracePage').SearchTracePage
- );
+ expect(SearchTracePage).toBe(require('../src/components/SearchTracePage').SearchTracePage);
});
/* eslint-enable global-require, import/newline-after-import */
diff --git a/src/middlewares/index.js b/src/middlewares/index.js
index 3c96369a2a..1aec10cb4b 100644
--- a/src/middlewares/index.js
+++ b/src/middlewares/index.js
@@ -28,36 +28,30 @@ import { searchTraces, fetchServiceOperations } from '../actions/jaeger-api';
/**
* Middleware to load "operations" for a particular service.
*/
-export const loadOperationsForServiceMiddleware = store =>
- next =>
- action => {
- if (
- action.type === '@@redux-form/CHANGE' &&
- action.meta.form === 'searchSideBar' &&
- action.meta.field === 'service' &&
- action.payload !== '-'
- ) {
- store.dispatch(fetchServiceOperations(action.payload));
- store.dispatch(change('searchSideBar', 'operation', 'all'));
- }
- return next(action);
- };
+export const loadOperationsForServiceMiddleware = store => next => action => {
+ if (
+ action.type === '@@redux-form/CHANGE' &&
+ action.meta.form === 'searchSideBar' &&
+ action.meta.field === 'service' &&
+ action.payload !== '-'
+ ) {
+ store.dispatch(fetchServiceOperations(action.payload));
+ store.dispatch(change('searchSideBar', 'operation', 'all'));
+ }
+ return next(action);
+};
-export const historyUpdateMiddleware = store =>
- next =>
- action => {
- switch (action.type) {
- case `${searchTraces}`: {
- store.dispatch(
- replace(`/search?${queryString.stringify(action.meta.query)}`)
- );
- break;
- }
- default:
- break;
- }
+export const historyUpdateMiddleware = store => next => action => {
+ switch (action.type) {
+ case `${searchTraces}`: {
+ store.dispatch(replace(`/search?${queryString.stringify(action.meta.query)}`));
+ break;
+ }
+ default:
+ break;
+ }
- next(action);
- };
+ next(action);
+};
export const promise = promiseMiddleware();
diff --git a/src/middlewares/index.test.js b/src/middlewares/index.test.js
index ae2d625f59..f4818dfbbf 100644
--- a/src/middlewares/index.test.js
+++ b/src/middlewares/index.test.js
@@ -34,7 +34,5 @@ it('loadOperationsForServiceMiddleware fetches operations for services', () => {
const action = change('searchSideBar', 'service', 'yo');
loadOperationsForServiceMiddleware({ dispatch })(next)(action);
expect(dispatch.calledWith(fetchServiceOperations('yo'))).toBeTruthy();
- expect(
- dispatch.calledWith(change('searchSideBar', 'operation', 'all'))
- ).toBeTruthy();
+ expect(dispatch.calledWith(change('searchSideBar', 'operation', 'all'))).toBeTruthy();
});
diff --git a/src/reducers/dependencies.js b/src/reducers/dependencies.js
index 03e91aee23..885162bb0a 100644
--- a/src/reducers/dependencies.js
+++ b/src/reducers/dependencies.js
@@ -31,23 +31,11 @@ export const initialState = Immutable.fromJS({
export default handleActions(
{
- [`${jaegerApiActions.fetchDependencies}_PENDING`]: state =>
- state.set('loading', true),
- [`${jaegerApiActions.fetchDependencies}_FULFILLED`]: (
- state,
- { payload: { data: dependencies } }
- ) =>
- state
- .set('loading', false)
- .set('dependencies', Immutable.fromJS(dependencies)),
- [`${jaegerApiActions.fetchDependencies}_REJECTED`]: (
- state,
- { payload: error }
- ) =>
- state
- .set('dependencies', Immutable.fromJS([]))
- .set('loading', false)
- .set('error', error),
+ [`${jaegerApiActions.fetchDependencies}_PENDING`]: state => state.set('loading', true),
+ [`${jaegerApiActions.fetchDependencies}_FULFILLED`]: (state, { payload: { data: dependencies } }) =>
+ state.set('loading', false).set('dependencies', Immutable.fromJS(dependencies)),
+ [`${jaegerApiActions.fetchDependencies}_REJECTED`]: (state, { payload: error }) =>
+ state.set('dependencies', Immutable.fromJS([])).set('loading', false).set('error', error),
},
initialState
);
diff --git a/src/reducers/services.js b/src/reducers/services.js
index 66e4944ed4..8e9ff45cb1 100644
--- a/src/reducers/services.js
+++ b/src/reducers/services.js
@@ -32,36 +32,17 @@ export const initialState = Immutable.fromJS({
export default handleActions(
{
- [`${jaegerApiActions.fetchServices}_PENDING`]: state =>
- state.set('loading', true),
- [`${jaegerApiActions.fetchServices}_FULFILLED`]: (
- state,
- { payload: { data: services } }
- ) =>
- state
- .set('loading', false)
- .set('error', null)
- .set('services', Immutable.fromJS(services).sort()),
- [`${jaegerApiActions.fetchServices}_REJECTED`]: (
- state,
- { payload: error }
- ) =>
- state
- .set('services', Immutable.fromJS([]))
- .set('loading', false)
- .set('error', error.message),
- [`${jaegerApiActions.fetchServiceOperations}_PENDING`]: (
- state,
- { meta: { serviceName } }
- ) => state.setIn(['operationsForService', serviceName], Immutable.List()),
+ [`${jaegerApiActions.fetchServices}_PENDING`]: state => state.set('loading', true),
+ [`${jaegerApiActions.fetchServices}_FULFILLED`]: (state, { payload: { data: services } }) =>
+ state.set('loading', false).set('error', null).set('services', Immutable.fromJS(services).sort()),
+ [`${jaegerApiActions.fetchServices}_REJECTED`]: (state, { payload: error }) =>
+ state.set('services', Immutable.fromJS([])).set('loading', false).set('error', error.message),
+ [`${jaegerApiActions.fetchServiceOperations}_PENDING`]: (state, { meta: { serviceName } }) =>
+ state.setIn(['operationsForService', serviceName], Immutable.List()),
[`${jaegerApiActions.fetchServiceOperations}_FULFILLED`]: (
state,
{ meta: { serviceName }, payload: { data: operations } }
- ) =>
- state.setIn(
- ['operationsForService', serviceName],
- Immutable.List(operations)
- ),
+ ) => state.setIn(['operationsForService', serviceName], Immutable.List(operations)),
},
initialState
);
diff --git a/src/reducers/services.test.js b/src/reducers/services.test.js
index 59c0c61d51..557d96dd9a 100644
--- a/src/reducers/services.test.js
+++ b/src/reducers/services.test.js
@@ -21,9 +21,7 @@
import Immutable from 'immutable';
import * as jaegerApiActions from '../../src/actions/jaeger-api';
-import serviceReducer, {
- initialState as servicesInitialState,
-} from '../../src/reducers/services';
+import serviceReducer, { initialState as servicesInitialState } from '../../src/reducers/services';
it('should initialize an empty services array', () => {
expect(
diff --git a/src/reducers/trace.js b/src/reducers/trace.js
index d6ca9d8839..e84360415c 100644
--- a/src/reducers/trace.js
+++ b/src/reducers/trace.js
@@ -32,39 +32,21 @@ export const initialState = Immutable.Map({
export default handleActions(
{
- [`${jaegerApiActions.fetchTrace}_PENDING`]: state =>
- state.set('loading', true),
- [`${jaegerApiActions.fetchTrace}_FULFILLED`]: (
- state,
- { meta: { id }, payload: { data: traces } }
- ) =>
- state
- .set('loading', false)
- .setIn(
- ['traces', id],
- Immutable.fromJS(enforceUniqueSpanIds(traces[0]))
- ),
- [`${jaegerApiActions.fetchTrace}_REJECTED`]: (
- state,
- { meta: { id }, payload: error }
- ) => state.set('loading', false).setIn(['traces', id], error),
- [`${jaegerApiActions.searchTraces}_PENDING`]: state =>
- state.set('loading', true),
+ [`${jaegerApiActions.fetchTrace}_PENDING`]: state => state.set('loading', true),
+ [`${jaegerApiActions.fetchTrace}_FULFILLED`]: (state, { meta: { id }, payload: { data: traces } }) =>
+ state.set('loading', false).setIn(['traces', id], Immutable.fromJS(enforceUniqueSpanIds(traces[0]))),
+ [`${jaegerApiActions.fetchTrace}_REJECTED`]: (state, { meta: { id }, payload: error }) =>
+ state.set('loading', false).setIn(['traces', id], error),
+ [`${jaegerApiActions.searchTraces}_PENDING`]: state => state.set('loading', true),
[`${jaegerApiActions.searchTraces}_FULFILLED`]: (state, action) => {
const traceResults = {};
action.payload.data.forEach(trace => {
traceResults[trace.traceID] = trace;
});
- return state
- .set('traces', Immutable.fromJS(traceResults))
- .set('loading', false)
- .set('error', null);
+ return state.set('traces', Immutable.fromJS(traceResults)).set('loading', false).set('error', null);
},
[`${jaegerApiActions.searchTraces}_REJECTED`]: (state, action) =>
- state
- .set('traces', Immutable.fromJS([]))
- .set('loading', false)
- .set('error', action.payload.message),
+ state.set('traces', Immutable.fromJS([])).set('loading', false).set('error', action.payload.message),
},
initialState
);
diff --git a/src/reducers/trace.test.js b/src/reducers/trace.test.js
index 9e56c60e00..2f56cae0aa 100644
--- a/src/reducers/trace.test.js
+++ b/src/reducers/trace.test.js
@@ -45,10 +45,7 @@ it('trace reducer should handle a successful FETCH_TRACE', () => {
});
expect(
- Immutable.is(
- state.get('traces'),
- Immutable.fromJS({ [getTraceId(generatedTrace)]: generatedTrace })
- )
+ Immutable.is(state.get('traces'), Immutable.fromJS({ [getTraceId(generatedTrace)]: generatedTrace }))
).toBeTruthy();
expect(state.get('loading')).toBe(false);
@@ -63,10 +60,7 @@ it('trace reducer should handle a failed FETCH_TRACE', () => {
});
expect(
- Immutable.is(
- state.get('traces'),
- Immutable.fromJS({ [generatedTrace.traceID]: error })
- )
+ Immutable.is(state.get('traces'), Immutable.fromJS({ [generatedTrace.traceID]: error }))
).toBeTruthy();
expect(state.get('loading')).toBe(false);
diff --git a/src/selectors/dependencies.js b/src/selectors/dependencies.js
index c948c6cb13..04393cd617 100644
--- a/src/selectors/dependencies.js
+++ b/src/selectors/dependencies.js
@@ -30,9 +30,7 @@ export const formatDependenciesAsNodesAndLinks = createSelector(
// add both the parent and child to the node map, or increment their
// call count.
- nodeMap[link.parent] = nodeMap[link.parent]
- ? nodeMap[link.parent] + link.callCount
- : link.callCount;
+ nodeMap[link.parent] = nodeMap[link.parent] ? nodeMap[link.parent] + link.callCount : link.callCount;
nodeMap[link.child] = nodeMap[link.child]
? response.nodeMap[link.child] + link.callCount
: link.callCount;
@@ -57,9 +55,7 @@ export const formatDependenciesAsNodesAndLinks = createSelector(
data.nodes = Object.keys(data.nodeMap).map(id => ({
callCount: data.nodeMap[id],
radius: Math.max(Math.log(data.nodeMap[id] / 1000), 3),
- orphan: data.links.findIndex(
- link => id === link.source || id === link.target
- ) === -1,
+ orphan: data.links.findIndex(link => id === link.source || id === link.target) === -1,
id,
}));
diff --git a/src/selectors/process.test.js b/src/selectors/process.test.js
index 3210f5ea49..d25eb394cb 100644
--- a/src/selectors/process.test.js
+++ b/src/selectors/process.test.js
@@ -24,17 +24,13 @@ import traceGenerator from '../demo/trace-generators';
const generatedTrace = traceGenerator.trace({ numberOfSpans: 45 });
it('getProcessServiceName() should return the serviceName of the process', () => {
- const proc = generatedTrace.processes[
- Object.keys(generatedTrace.processes)[0]
- ];
+ const proc = generatedTrace.processes[Object.keys(generatedTrace.processes)[0]];
expect(processSelectors.getProcessServiceName(proc)).toBe(proc.serviceName);
});
it('getProcessTags() should return the tags on the process', () => {
- const proc = generatedTrace.processes[
- Object.keys(generatedTrace.processes)[0]
- ];
+ const proc = generatedTrace.processes[Object.keys(generatedTrace.processes)[0]];
expect(processSelectors.getProcessTags(proc)).toBe(proc.tags);
});
diff --git a/src/selectors/search.js b/src/selectors/search.js
index 7af0e33850..0199b7da65 100644
--- a/src/selectors/search.js
+++ b/src/selectors/search.js
@@ -33,22 +33,19 @@ const getTrace = state => state.trace;
export function calculatePercentOfTotal(timestamps) {
const timestampsByStartTime = sortBy(timestamps, t => t[0]);
let lastTimestamp;
- const duration = timestampsByStartTime.reduce(
- (lastDuration, t) => {
- let newDuration;
- if (lastTimestamp >= t[1]) {
- newDuration = lastDuration;
- } else if (lastTimestamp > t[0] && lastTimestamp < t[1]) {
- newDuration = lastDuration + (t[1] - lastTimestamp);
- lastTimestamp = t[1];
- } else {
- newDuration = lastDuration + (t[1] - t[0]);
- lastTimestamp = t[1];
- }
- return newDuration;
- },
- 0
- );
+ const duration = timestampsByStartTime.reduce((lastDuration, t) => {
+ let newDuration;
+ if (lastTimestamp >= t[1]) {
+ newDuration = lastDuration;
+ } else if (lastTimestamp > t[0] && lastTimestamp < t[1]) {
+ newDuration = lastDuration + (t[1] - lastTimestamp);
+ lastTimestamp = t[1];
+ } else {
+ newDuration = lastDuration + (t[1] - t[0]);
+ lastTimestamp = t[1];
+ }
+ return newDuration;
+ }, 0);
return duration;
}
@@ -64,10 +61,7 @@ export function transformTrace(trace) {
if (!processMap[processName]) {
processMap[processName] = [];
}
- processMap[processName].push([
- span.startTime,
- span.startTime + span.duration,
- ]);
+ processMap[processName].push([span.startTime, span.startTime + span.duration]);
});
}
@@ -78,10 +72,7 @@ export function transformTrace(trace) {
name: processName,
numberOfApperancesInTrace: timestamps.length,
percentOfTrace: Math.round(
- getPercentageOfDuration(
- calculatePercentOfTotal(timestamps),
- traceDuration
- ),
+ getPercentageOfDuration(calculatePercentOfTotal(timestamps), traceDuration),
-1
),
};
@@ -122,7 +113,8 @@ export function transformTraceResults(rawTraces) {
};
}
export const transformTraceResultsSelector = createSelector(getTraces, traces =>
- transformTraceResults(traces));
+ transformTraceResults(traces)
+);
// Sorting options
export const MOST_RECENT = 'MOST_RECENT';
diff --git a/src/selectors/search.test.js b/src/selectors/search.test.js
index 18e8323737..6cfe10b0db 100644
--- a/src/selectors/search.test.js
+++ b/src/selectors/search.test.js
@@ -49,9 +49,7 @@ it('transformTraceResults() calculates the max duration of all traces', () => {
const traceDurationOne = searchSelectors.transformTrace(traces[0]).duration;
const traceDurationTwo = searchSelectors.transformTrace(traces[1]).duration;
- const expectedMaxDuration = traceDurationOne > traceDurationTwo
- ? traceDurationOne
- : traceDurationTwo;
+ const expectedMaxDuration = traceDurationOne > traceDurationTwo ? traceDurationOne : traceDurationTwo;
const { maxDuration } = searchSelectors.transformTraceResults(traces);
@@ -78,24 +76,16 @@ it('getSortedTraceResults() sorting works', () => {
const maxDurationTraceID = maxBy(traces, trace => trace.duration).traceID;
const minDurationTraceID = minBy(traces, trace => trace.duration).traceID;
const mostRecentTraceID = maxBy(traces, trace => trace.timestamp).traceID;
- expect(getSortedTraceResults(traces, MOST_RECENT)[0].traceID).toBe(
- mostRecentTraceID
- );
+ expect(getSortedTraceResults(traces, MOST_RECENT)[0].traceID).toBe(mostRecentTraceID);
- expect(getSortedTraceResults(traces, LONGEST_FIRST)[0].traceID).toBe(
- maxDurationTraceID
- );
+ expect(getSortedTraceResults(traces, LONGEST_FIRST)[0].traceID).toBe(maxDurationTraceID);
- expect(getSortedTraceResults(traces, SHORTEST_FIRST)[0].traceID).toBe(
- minDurationTraceID
- );
+ expect(getSortedTraceResults(traces, SHORTEST_FIRST)[0].traceID).toBe(minDurationTraceID);
expect(getSortedTraceResults(traces, MOST_SPANS)[0].traceID).toBe(2);
expect(getSortedTraceResults(traces, LEAST_SPANS)[0].traceID).toBe(4);
- expect(getSortedTraceResults(traces, 'invalid')[0].traceID).toBe(
- maxDurationTraceID
- );
+ expect(getSortedTraceResults(traces, 'invalid')[0].traceID).toBe(maxDurationTraceID);
});
it('calculatePercentOfTotal() works properly', () => {
@@ -114,8 +104,6 @@ it('calculatePercentOfTotal() works properly', () => {
},
];
testCases.forEach(testCase => {
- expect(searchSelectors.calculatePercentOfTotal(testCase.input)).toBe(
- testCase.expectedOutput
- );
+ expect(searchSelectors.calculatePercentOfTotal(testCase.input)).toBe(testCase.expectedOutput);
});
});
diff --git a/src/selectors/span.js b/src/selectors/span.js
index 8c19410a3f..cba594925b 100644
--- a/src/selectors/span.js
+++ b/src/selectors/span.js
@@ -36,7 +36,7 @@ export const getSpanReferenceByType = createSelector(
);
export const getSpanParentId = createSelector(
span => getSpanReferenceByType({ span, type: 'CHILD_OF' }),
- childOfRef => childOfRef ? childOfRef.spanID : null
+ childOfRef => (childOfRef ? childOfRef.spanID : null)
);
export const getSpanProcess = span => {
@@ -52,21 +52,14 @@ export const getSpanProcess = span => {
return span.process;
};
-export const getSpanServiceName = createSelector(
- getSpanProcess,
- getProcessServiceName
-);
+export const getSpanServiceName = createSelector(getSpanProcess, getProcessServiceName);
export const filterSpansForTimestamps = createSelector(
({ spans }) => spans,
({ leftBound }) => leftBound,
({ rightBound }) => rightBound,
(spans, leftBound, rightBound) =>
- spans.filter(
- span =>
- getSpanTimestamp(span) >= leftBound &&
- getSpanTimestamp(span) <= rightBound
- )
+ spans.filter(span => getSpanTimestamp(span) >= leftBound && getSpanTimestamp(span) <= rightBound)
);
export const filterSpansForText = createSelector(
@@ -80,16 +73,14 @@ export const filterSpansForText = createSelector(
.map(({ original }) => original)
);
-const getTextFilterdSpansAsMap = createSelector(
- filterSpansForText,
- matchingSpans =>
- matchingSpans.reduce(
- (obj, span) => ({
- ...obj,
- [getSpanId(span)]: span,
- }),
- {}
- )
+const getTextFilterdSpansAsMap = createSelector(filterSpansForText, matchingSpans =>
+ matchingSpans.reduce(
+ (obj, span) => ({
+ ...obj,
+ [getSpanId(span)]: span,
+ }),
+ {}
+ )
);
export const highlightSpansForTextFilter = createSelector(
diff --git a/src/selectors/span.test.js b/src/selectors/span.test.js
index b373e6f635..76a1325cec 100644
--- a/src/selectors/span.test.js
+++ b/src/selectors/span.test.js
@@ -77,9 +77,7 @@ it('getSpanReferenceByType() should return undefined if one does not exist', ()
it('getSpanParentId() should return the spanID of the parent span', () => {
expect(spanSelectors.getSpanParentId(generatedTrace.spans[1])).toBe(
- generatedTrace.spans[1].references.find(
- ({ refType }) => refType === 'CHILD_OF'
- ).spanID
+ generatedTrace.spans[1].references.find(({ refType }) => refType === 'CHILD_OF').spanID
);
});
diff --git a/src/selectors/trace.js b/src/selectors/trace.js
index a118c1447c..f0da4b96f9 100644
--- a/src/selectors/trace.js
+++ b/src/selectors/trace.js
@@ -30,11 +30,7 @@ import {
getSpanProcessId,
} from './span';
import { getProcessServiceName } from './process';
-import {
- formatMillisecondTime,
- formatSecondTime,
- ONE_SECOND,
-} from '../utils/date';
+import { formatMillisecondTime, formatSecondTime, ONE_SECOND } from '../utils/date';
import { numberSortComparator } from '../utils/sort';
import TreeNode from '../utils/TreeNode';
@@ -52,7 +48,8 @@ const getSpanWithProcess = createSelector(
);
export const getTraceSpansAsMap = createSelector(getTraceSpans, spans =>
- spans.reduce((map, span) => map.set(getSpanId(span), span), new Map()));
+ spans.reduce((map, span) => map.set(getSpanId(span), span), new Map())
+);
export const TREE_ROOT_ID = '__root__';
@@ -82,25 +79,23 @@ function insertSpanIntoTree(tree, span, spanMap) {
return tree;
}
-export const getTraceSpanIdsAsTree = createSelector(
- getTraceSpans,
- getTraceSpansAsMap,
- (spans, spanMap) => {
- const result = spans.reduce(
- (tree, span) => insertSpanIntoTree(tree, span, spanMap),
- new TreeNode(TREE_ROOT_ID)
- );
-
- result.walk((value, node) =>
- node.children.sort((nodeA, nodeB) =>
- numberSortComparator(
- getSpanTimestamp(spanMap.get(nodeA.value)),
- getSpanTimestamp(spanMap.get(nodeB.value))
- )));
-
- return result;
- }
-);
+export const getTraceSpanIdsAsTree = createSelector(getTraceSpans, getTraceSpansAsMap, (spans, spanMap) => {
+ const result = spans.reduce(
+ (tree, span) => insertSpanIntoTree(tree, span, spanMap),
+ new TreeNode(TREE_ROOT_ID)
+ );
+
+ result.walk((value, node) =>
+ node.children.sort((nodeA, nodeB) =>
+ numberSortComparator(
+ getSpanTimestamp(spanMap.get(nodeA.value)),
+ getSpanTimestamp(spanMap.get(nodeB.value))
+ )
+ )
+ );
+
+ return result;
+});
// attach "process" as an object to each span.
export const hydrateSpansWithProcesses = trace => {
@@ -113,34 +108,24 @@ export const hydrateSpansWithProcesses = trace => {
};
};
-export const getTraceSpanCount = createSelector(
- getTraceSpans,
- spans => spans.length
-);
+export const getTraceSpanCount = createSelector(getTraceSpans, spans => spans.length);
export const getTraceTimestamp = createSelector(getTraceSpans, spans =>
spans.reduce(
(prevTimestamp, span) =>
- prevTimestamp
- ? Math.min(prevTimestamp, getSpanTimestamp(span))
- : getSpanTimestamp(span),
+ prevTimestamp ? Math.min(prevTimestamp, getSpanTimestamp(span)) : getSpanTimestamp(span),
null
- ));
+ )
+);
-export const getTraceDuration = createSelector(
- getTraceSpans,
- getTraceTimestamp,
- (spans, timestamp) =>
- spans.reduce(
- (prevDuration, span) =>
- prevDuration
- ? Math.max(
- getSpanTimestamp(span) - timestamp + getSpanDuration(span),
- prevDuration
- )
- : getSpanDuration(span),
- null
- )
+export const getTraceDuration = createSelector(getTraceSpans, getTraceTimestamp, (spans, timestamp) =>
+ spans.reduce(
+ (prevDuration, span) =>
+ prevDuration
+ ? Math.max(getSpanTimestamp(span) - timestamp + getSpanDuration(span), prevDuration)
+ : getSpanDuration(span),
+ null
+ )
);
export const getTraceEndTimestamp = createSelector(
@@ -155,16 +140,10 @@ export const getParentSpan = createSelector(
(tree, spanMap) =>
tree.children
.map(node => spanMap.get(node.value))
- .sort((spanA, spanB) =>
- numberSortComparator(getSpanTimestamp(spanA), getSpanTimestamp(spanB)))[
- 0
- ]
+ .sort((spanA, spanB) => numberSortComparator(getSpanTimestamp(spanA), getSpanTimestamp(spanB)))[0]
);
-export const getTraceDepth = createSelector(
- getTraceSpanIdsAsTree,
- spanTree => spanTree.depth - 1
-);
+export const getTraceDepth = createSelector(getTraceSpanIdsAsTree, spanTree => spanTree.depth - 1);
export const getSpanDepthForTrace = createSelector(
createSelector(state => state.trace, getTraceSpanIdsAsTree),
@@ -174,16 +153,13 @@ export const getSpanDepthForTrace = createSelector(
export const getTraceServices = createSelector(getTraceProcesses, processes =>
Object.keys(processes).reduce(
- (services, processID) =>
- services.add(getProcessServiceName(processes[processID])),
+ (services, processID) => services.add(getProcessServiceName(processes[processID])),
new Set()
- ));
-
-export const getTraceServiceCount = createSelector(
- getTraceServices,
- services => services.size
+ )
);
+export const getTraceServiceCount = createSelector(getTraceServices, services => services.size);
+
// establish constants to determine how math should be handled
// for nanosecond-to-millisecond conversions.
export const DURATION_FORMATTERS = {
@@ -193,8 +169,7 @@ export const DURATION_FORMATTERS = {
const getDurationFormatterForTrace = createSelector(
getTraceDuration,
- totalDuration =>
- totalDuration >= ONE_SECOND ? DURATION_FORMATTERS.s : DURATION_FORMATTERS.ms
+ totalDuration => (totalDuration >= ONE_SECOND ? DURATION_FORMATTERS.s : DURATION_FORMATTERS.ms)
);
export const formatDurationForUnit = createSelector(
@@ -214,21 +189,15 @@ export const getSortedSpans = createSelector(
({ spans }) => spans,
({ sort }) => sort,
(trace, spans, { dir, comparator, selector }) =>
- [...spans].sort(
- (spanA, spanB) =>
- dir * comparator(selector(spanA, trace), selector(spanB, trace))
- )
+ [...spans].sort((spanA, spanB) => dir * comparator(selector(spanA, trace), selector(spanB, trace)))
);
-const getTraceSpansByHierarchyPosition = createSelector(
- getTraceSpanIdsAsTree,
- tree => {
- const hierarchyPositionMap = new Map();
- let i = 0;
- tree.walk(spanID => hierarchyPositionMap.set(spanID, i++));
- return hierarchyPositionMap;
- }
-);
+const getTraceSpansByHierarchyPosition = createSelector(getTraceSpanIdsAsTree, tree => {
+ const hierarchyPositionMap = new Map();
+ let i = 0;
+ tree.walk(spanID => hierarchyPositionMap.set(spanID, i++));
+ return hierarchyPositionMap;
+});
export const getTreeSizeForTraceSpan = createSelector(
createSelector(state => state.trace, getTraceSpanIdsAsTree),
@@ -264,19 +233,12 @@ export const omitCollapsedSpans = createSelector(
createSelector(({ trace }) => trace, getTraceSpanIdsAsTree),
({ collapsed }) => collapsed,
(spans, tree, collapse) => {
- const hiddenSpanIds = collapse.reduce(
- (result, collapsedSpanId) => {
- tree
- .find(collapsedSpanId)
- .walk(id => id !== collapsedSpanId && result.add(id));
- return result;
- },
- new Set()
- );
-
- return hiddenSpanIds.size > 0
- ? spans.filter(span => !hiddenSpanIds.has(getSpanId(span)))
- : spans;
+ const hiddenSpanIds = collapse.reduce((result, collapsedSpanId) => {
+ tree.find(collapsedSpanId).walk(id => id !== collapsedSpanId && result.add(id));
+ return result;
+ }, new Set());
+
+ return hiddenSpanIds.size > 0 ? spans.filter(span => !hiddenSpanIds.has(getSpanId(span))) : spans;
}
);
@@ -293,8 +255,7 @@ export const getTicksForTrace = createSelector(
// timestamps will be spaced over the interval, starting from the initial timestamp
) =>
[...Array(interval + 1).keys()].map(num => ({
- timestamp: getTraceTimestamp(trace) +
- getTraceDuration(trace) * (num / interval),
+ timestamp: getTraceTimestamp(trace) + getTraceDuration(trace) * (num / interval),
width,
}))
);
@@ -309,29 +270,21 @@ export const enforceUniqueSpanIds = createSelector(
return {
...trace,
- spans: spans.reduce(
- (result, span) => {
- const spanID = map.has(getSpanId(span))
- ? `${getSpanId(span)}_${map.get(getSpanId(span))}`
- : getSpanId(span);
- const updatedSpan = { ...span, spanID };
-
- if (spanID !== getSpanId(span)) {
- console.warn(
- 'duplicate spanID in trace replaced',
- getSpanId(span),
- 'new:',
- spanID
- );
- }
-
- // set the presence of the span in the map or increment the number
- map.set(getSpanId(span), (map.get(getSpanId(span)) || 0) + 1);
-
- return result.concat([updatedSpan]);
- },
- []
- ),
+ spans: spans.reduce((result, span) => {
+ const spanID = map.has(getSpanId(span))
+ ? `${getSpanId(span)}_${map.get(getSpanId(span))}`
+ : getSpanId(span);
+ const updatedSpan = { ...span, spanID };
+
+ if (spanID !== getSpanId(span)) {
+ console.warn('duplicate spanID in trace replaced', getSpanId(span), 'new:', spanID);
+ }
+
+ // set the presence of the span in the map or increment the number
+ map.set(getSpanId(span), (map.get(getSpanId(span)) || 0) + 1);
+
+ return result.concat([updatedSpan]);
+ }, []),
};
}
);
diff --git a/src/selectors/trace.test.js b/src/selectors/trace.test.js
index b77fe5cf5e..ea7aa0c9e4 100644
--- a/src/selectors/trace.test.js
+++ b/src/selectors/trace.test.js
@@ -36,29 +36,22 @@ import { numberSortComparator } from '../../src/utils/sort';
const generatedTrace = traceGenerator.trace({ numberOfSpans: 45 });
it('getTraceId() should return the traceID', () => {
- expect(traceSelectors.getTraceId(generatedTrace)).toBe(
- generatedTrace.traceID
- );
+ expect(traceSelectors.getTraceId(generatedTrace)).toBe(generatedTrace.traceID);
});
it('hydrateSpansWithProcesses() should return the trace with processes on each span', () => {
- const hydratedTrace = traceSelectors.hydrateSpansWithProcesses(
- generatedTrace
- );
+ const hydratedTrace = traceSelectors.hydrateSpansWithProcesses(generatedTrace);
hydratedTrace.spans.forEach(span =>
- expect(getSpanProcess(span)).toBe(
- generatedTrace.processes[getSpanProcessId(span)]
- ));
+ expect(getSpanProcess(span)).toBe(generatedTrace.processes[getSpanProcessId(span)])
+ );
});
it('getTraceSpansAsMap() should return a map of all of the spans', () => {
const spanMap = traceSelectors.getTraceSpansAsMap(generatedTrace);
for (const duple of spanMap) {
- expect(duple[1]).toEqual(
- generatedTrace.spans.find(span => getSpanId(span) === duple[0])
- );
+ expect(duple[1]).toEqual(generatedTrace.spans.find(span => getSpanId(span) === duple[0]));
}
});
@@ -67,13 +60,9 @@ it('getTraceSpanIdsAsTree() should build the tree properly', () => {
const spanMap = traceSelectors.getTraceSpansAsMap(generatedTrace);
tree.walk((value, node) => {
- const expectedParentValue = value === traceSelectors.TREE_ROOT_ID
- ? null
- : value;
+ const expectedParentValue = value === traceSelectors.TREE_ROOT_ID ? null : value;
node.children.forEach(childNode => {
- expect(getSpanParentId(spanMap.get(childNode.value))).toBe(
- expectedParentValue
- );
+ expect(getSpanParentId(spanMap.get(childNode.value))).toBe(expectedParentValue);
});
});
});
@@ -82,9 +71,7 @@ it('getParentSpan() should return the parent span of the tree', () => {
expect(traceSelectors.getParentSpan(generatedTrace)).toBe(
traceSelectors
.getTraceSpansAsMap(generatedTrace)
- .get(
- traceSelectors.getTraceSpanIdsAsTree(generatedTrace).children[0].value
- )
+ .get(traceSelectors.getTraceSpanIdsAsTree(generatedTrace).children[0].value)
);
});
@@ -116,9 +103,7 @@ it('getParentSpan() should return the first span if there are multiple parents',
});
it('getTraceName() should return a formatted name for the first span', () => {
- const hydratedTrace = traceSelectors.hydrateSpansWithProcesses(
- generatedTrace
- );
+ const hydratedTrace = traceSelectors.hydrateSpansWithProcesses(generatedTrace);
const parentSpan = traceSelectors.getParentSpan(hydratedTrace);
expect(traceSelectors.getTraceName(hydratedTrace)).toBe(
@@ -127,21 +112,15 @@ it('getTraceName() should return a formatted name for the first span', () => {
});
it('getTraceSpanCount() should return the length of the spans array', () => {
- expect(traceSelectors.getTraceSpanCount(generatedTrace)).toBe(
- generatedTrace.spans.length
- );
+ expect(traceSelectors.getTraceSpanCount(generatedTrace)).toBe(generatedTrace.spans.length);
});
it('getTraceDuration() should return the duration for the span', () => {
- expect(traceSelectors.getTraceDuration(generatedTrace)).toBe(
- generatedTrace.spans[0].duration
- );
+ expect(traceSelectors.getTraceDuration(generatedTrace)).toBe(generatedTrace.spans[0].duration);
});
it('getTraceTimestamp() should return the first timestamp for the conventional trace', () => {
- expect(traceSelectors.getTraceTimestamp(generatedTrace)).toBe(
- generatedTrace.spans[0].startTime
- );
+ expect(traceSelectors.getTraceTimestamp(generatedTrace)).toBe(generatedTrace.spans[0].startTime);
});
it('getTraceDepth() should determine the total depth of the trace tree', () => {
@@ -158,9 +137,7 @@ it('getSpanDepthForTrace() should determine the depth of a given span in the par
const findCurrentSpanById = item => getSpanId(item) === currentId;
while (currentId !== getSpanId(generatedTrace.spans[0])) {
depth++;
- currentId = getSpanParentId(
- generatedTrace.spans.find(findCurrentSpanById)
- );
+ currentId = getSpanParentId(generatedTrace.spans.find(findCurrentSpanById));
}
// console.log('hypothetical depth', depth);
@@ -175,15 +152,9 @@ it('getSpanDepthForTrace() should determine the depth of a given span in the par
// test depth calculations for a few random spans
testDepthCalc(generatedTrace.spans[1]);
- testDepthCalc(
- generatedTrace.spans[Math.floor(generatedTrace.spans.length / 2)]
- );
- testDepthCalc(
- generatedTrace.spans[Math.floor(generatedTrace.spans.length / 4)]
- );
- testDepthCalc(
- generatedTrace.spans[Math.floor(generatedTrace.spans.length * 0.75)]
- );
+ testDepthCalc(generatedTrace.spans[Math.floor(generatedTrace.spans.length / 2)]);
+ testDepthCalc(generatedTrace.spans[Math.floor(generatedTrace.spans.length / 4)]);
+ testDepthCalc(generatedTrace.spans[Math.floor(generatedTrace.spans.length * 0.75)]);
});
it('getTraceServices() should return an unique array of all services in the trace', () => {
@@ -191,8 +162,7 @@ it('getTraceServices() should return an unique array of all services in the trac
setsEqual(
new Set(traceSelectors.getTraceServices(generatedTrace)),
generatedTrace.spans.reduce(
- (results, { processID }) =>
- results.add(generatedTrace.processes[processID].serviceName),
+ (results, { processID }) => results.add(generatedTrace.processes[processID].serviceName),
new Set()
)
)
@@ -202,29 +172,20 @@ it('getTraceServices() should return an unique array of all services in the trac
it('getTraceServiceCount() should return the length of the service list', () => {
expect(traceSelectors.getTraceServiceCount(generatedTrace)).toBe(
generatedTrace.spans.reduce(
- (results, { processID }) =>
- results.add(generatedTrace.processes[processID].serviceName),
+ (results, { processID }) => results.add(generatedTrace.processes[processID].serviceName),
new Set()
).size
);
});
it('formatDurationForUnit() should use the formatters to return the proper value', () => {
- expect(
- traceSelectors.formatDurationForUnit({ duration: 302000, unit: 'ms' })
- ).toBe('302ms');
+ expect(traceSelectors.formatDurationForUnit({ duration: 302000, unit: 'ms' })).toBe('302ms');
- expect(
- traceSelectors.formatDurationForUnit({ duration: 1302000, unit: 'ms' })
- ).toBe('1302ms');
+ expect(traceSelectors.formatDurationForUnit({ duration: 1302000, unit: 'ms' })).toBe('1302ms');
- expect(
- traceSelectors.formatDurationForUnit({ duration: 1302000, unit: 's' })
- ).toBe('1.302s');
+ expect(traceSelectors.formatDurationForUnit({ duration: 1302000, unit: 's' })).toBe('1.302s');
- expect(
- traceSelectors.formatDurationForUnit({ duration: 90000, unit: 's' })
- ).toBe('0.09s');
+ expect(traceSelectors.formatDurationForUnit({ duration: 90000, unit: 's' })).toBe('0.09s');
});
it('formatDurationForTrace() should return a ms value for traces shorter than a second', () => {
@@ -281,11 +242,7 @@ it('getSortedSpans() should sort spans given a sort object', () => {
selector: getSpanTimestamp,
},
})
- ).toEqual(
- [...generatedTrace.spans].sort(
- (spanA, spanB) => spanA.startTime - spanB.startTime
- )
- );
+ ).toEqual([...generatedTrace.spans].sort((spanA, spanB) => spanA.startTime - spanB.startTime));
expect(
traceSelectors.getSortedSpans({
@@ -297,11 +254,7 @@ it('getSortedSpans() should sort spans given a sort object', () => {
selector: getSpanTimestamp,
},
})
- ).toEqual(
- [...generatedTrace.spans].sort(
- (spanA, spanB) => spanB.startTime - spanA.startTime
- )
- );
+ ).toEqual([...generatedTrace.spans].sort((spanA, spanB) => spanB.startTime - spanA.startTime));
});
it('getTreeSizeForTraceSpan() should return the size for the parent span', () => {
@@ -319,11 +272,7 @@ it('getTreeSizeForTraceSpan() should return the size for a child span', () => {
trace: generatedTrace,
span: generatedTrace.spans[1],
})
- ).toBe(
- traceSelectors
- .getTraceSpanIdsAsTree(generatedTrace)
- .find(generatedTrace.spans[1].spanID).size - 1
- );
+ ).toBe(traceSelectors.getTraceSpanIdsAsTree(generatedTrace).find(generatedTrace.spans[1].spanID).size - 1);
});
it('getTreeSizeForTraceSpan() should return -1 for an absent span', () => {
@@ -336,21 +285,15 @@ it('getTreeSizeForTraceSpan() should return -1 for an absent span', () => {
});
it('getTraceName() should return the trace name based on the parentSpan', () => {
- const serviceName = generatedTrace.processes[
- generatedTrace.spans[0].processID
- ].serviceName;
+ const serviceName = generatedTrace.processes[generatedTrace.spans[0].processID].serviceName;
const operationName = generatedTrace.spans[0].operationName;
- expect(traceSelectors.getTraceName(generatedTrace)).toBe(
- `${serviceName}: ${operationName}`
- );
+ expect(traceSelectors.getTraceName(generatedTrace)).toBe(`${serviceName}: ${operationName}`);
});
it('omitCollapsedSpans() should filter out collaped spans', () => {
const span = generatedTrace.spans[1];
- const size = traceSelectors
- .getTraceSpanIdsAsTree(generatedTrace)
- .find(span.spanID).size - 1;
+ const size = traceSelectors.getTraceSpanIdsAsTree(generatedTrace).find(span.spanID).size - 1;
expect(
traceSelectors.omitCollapsedSpans({
diff --git a/src/utils/TreeNode.js b/src/utils/TreeNode.js
index 622ba21c6a..e889c59292 100644
--- a/src/utils/TreeNode.js
+++ b/src/utils/TreeNode.js
@@ -28,8 +28,7 @@ export default class TreeNode {
return search;
}
- return (value, node) =>
- search instanceof TreeNode ? node === search : value === search;
+ return (value, node) => (search instanceof TreeNode ? node === search : value === search);
}
constructor(value, children = []) {
diff --git a/src/utils/TreeNode.test.js b/src/utils/TreeNode.test.js
index abdc805605..c544733c64 100644
--- a/src/utils/TreeNode.test.js
+++ b/src/utils/TreeNode.test.js
@@ -85,9 +85,7 @@ it('addChild() should add a child to the set', () => {
treeRoot.addChild(1);
treeRoot.addChild(2);
- expect(treeRoot).toEqual(
- new TreeNode(4, [new TreeNode(3), new TreeNode(1), new TreeNode(2)])
- );
+ expect(treeRoot).toEqual(new TreeNode(4, [new TreeNode(3), new TreeNode(1), new TreeNode(2)]));
});
it('addChild() should support taking a treenode', () => {
@@ -97,9 +95,7 @@ it('addChild() should support taking a treenode', () => {
treeRoot.addChild(1);
treeRoot.addChild(2);
- expect(treeRoot).toEqual(
- new TreeNode(4, [otherNode, new TreeNode(1), new TreeNode(2)])
- );
+ expect(treeRoot).toEqual(new TreeNode(4, [otherNode, new TreeNode(1), new TreeNode(2)]));
});
it('addChild() should support the parent argument for nested insertion', () => {
@@ -109,9 +105,7 @@ it('addChild() should support the parent argument for nested insertion', () => {
treeRoot.addChild(secondTier);
secondTier.addChild(thirdTier);
- expect(treeRoot).toEqual(
- new TreeNode(1, [new TreeNode(2, [new TreeNode(3)])])
- );
+ expect(treeRoot).toEqual(new TreeNode(1, [new TreeNode(2, [new TreeNode(3)])]));
});
it('find() should return the found item for a function', () => {
@@ -215,11 +209,7 @@ it('getPath() should return the path to the node', () => {
treeRoot.addChild(11);
treeRoot.addChild(12);
- expect(treeRoot.getPath(secondChildNode)).toEqual([
- treeRoot,
- firstChildNode,
- secondChildNode,
- ]);
+ expect(treeRoot.getPath(secondChildNode)).toEqual([treeRoot, firstChildNode, secondChildNode]);
});
it('getPath() should return null if the node is not in the tree', () => {
diff --git a/src/utils/configure-store.js b/src/utils/configure-store.js
index 96a14aed7b..38a0266bdf 100644
--- a/src/utils/configure-store.js
+++ b/src/utils/configure-store.js
@@ -33,14 +33,9 @@ export default function configureStore(history) {
}),
compose(
applyMiddleware(
- ...[
- ...Object.keys(jaegerMiddlewares).map(key => jaegerMiddlewares[key]),
- routerMiddleware(history),
- ]
+ ...[...Object.keys(jaegerMiddlewares).map(key => jaegerMiddlewares[key]), routerMiddleware(history)]
),
- window && window.devToolsExtension
- ? window.devToolsExtension()
- : noop => noop
+ window && window.devToolsExtension ? window.devToolsExtension() : noop => noop
)
);
}
diff --git a/src/utils/date.js b/src/utils/date.js
index cf82d24a4c..b38be0b5c1 100644
--- a/src/utils/date.js
+++ b/src/utils/date.js
@@ -47,17 +47,12 @@ export function getPercentageOfDuration(duration, totalDuration) {
* @return {number} 0-100 percentage value for location of timestamp in interval starting
* at initialTimestamp and lasting totalDuration
*/
-export function getPercentageOfInterval(
- timestamp,
- initialTimestamp,
- totalDuration
-) {
+export function getPercentageOfInterval(timestamp, initialTimestamp, totalDuration) {
return getPercentageOfDuration(timestamp - initialTimestamp, totalDuration);
}
const quantizeDuration = (duration, floatPrecision, conversionFactor) =>
- toFloatPrecision(duration / conversionFactor, floatPrecision) *
- conversionFactor;
+ toFloatPrecision(duration / conversionFactor, floatPrecision) * conversionFactor;
/**
* @param {number} duration (in microseconds)
@@ -88,14 +83,8 @@ export function formatDatetime(duration) {
* @return {string} formatted, unit-labelled string with time in milliseconds
*/
export function formatMillisecondTime(duration) {
- const targetDuration = quantizeDuration(
- duration,
- DEFAULT_MS_PRECISION,
- ONE_MILLISECOND
- );
- return `${moment
- .duration(targetDuration / ONE_MILLISECOND)
- .asMilliseconds()}ms`;
+ const targetDuration = quantizeDuration(duration, DEFAULT_MS_PRECISION, ONE_MILLISECOND);
+ return `${moment.duration(targetDuration / ONE_MILLISECOND).asMilliseconds()}ms`;
}
/**
@@ -103,11 +92,7 @@ export function formatMillisecondTime(duration) {
* @return {string} formatted, unit-labelled string with time in seconds
*/
export function formatSecondTime(duration) {
- const targetDuration = quantizeDuration(
- duration,
- DEFAULT_MS_PRECISION,
- ONE_SECOND
- );
+ const targetDuration = quantizeDuration(duration, DEFAULT_MS_PRECISION, ONE_SECOND);
return `${moment.duration(targetDuration / ONE_MILLISECOND).asSeconds()}s`;
}
diff --git a/src/utils/get-last-xform-cacher.js b/src/utils/get-last-xform-cacher.js
index 7c8c9782ce..91e6dae82c 100644
--- a/src/utils/get-last-xform-cacher.js
+++ b/src/utils/get-last-xform-cacher.js
@@ -35,9 +35,8 @@ export default function getLastXformCacher(xformer) {
let lastXformed = null;
return function getOrCache(...args) {
- const sameArgs = lastArgs &&
- lastArgs.length === args.length &&
- lastArgs.every((lastArg, i) => lastArg === args[i]);
+ const sameArgs =
+ lastArgs && lastArgs.length === args.length && lastArgs.every((lastArg, i) => lastArg === args[i]);
if (sameArgs) {
return lastXformed;
}
diff --git a/src/utils/metrics.js b/src/utils/metrics.js
index 0d70f9ef54..1e367df016 100644
--- a/src/utils/metrics.js
+++ b/src/utils/metrics.js
@@ -20,9 +20,7 @@
import ReactGA from 'react-ga';
-if (
- process.env.NODE_ENV === 'production' && process.env.REACT_APP_GA_TRACKING_ID
-) {
+if (process.env.NODE_ENV === 'production' && process.env.REACT_APP_GA_TRACKING_ID) {
const GA_CODE = process.env.REACT_APP_GA_TRACKING_ID;
ReactGA.initialize(GA_CODE);
}
diff --git a/src/utils/sort.js b/src/utils/sort.js
index a8ca7112c8..eba0f304d7 100644
--- a/src/utils/sort.js
+++ b/src/utils/sort.js
@@ -39,17 +39,9 @@ export function getNewSortForClick(prevSort, column) {
};
}
-export function createSortClickHandler(
- column,
- currentSortKey,
- currentSortDir,
- updateSort
-) {
+export function createSortClickHandler(column, currentSortKey, currentSortDir, updateSort) {
return function onClickSortingElement() {
- const { key, dir } = getNewSortForClick(
- { key: currentSortKey, dir: currentSortDir },
- column
- );
+ const { key, dir } = getNewSortForClick({ key: currentSortKey, dir: currentSortDir }, column);
updateSort(key, dir);
};
}
diff --git a/src/utils/sort.test.js b/src/utils/sort.test.js
index 14455097e0..0e275db13a 100644
--- a/src/utils/sort.test.js
+++ b/src/utils/sort.test.js
@@ -23,18 +23,7 @@ import sinon from 'sinon';
import * as sortUtils from './sort';
it('stringSortComparator() should properly sort a list of strings', () => {
- const arr = [
- 'allen',
- 'Gustav',
- 'paul',
- 'Tim',
- 'abernathy',
- 'tucker',
- 'Steve',
- 'mike',
- 'John',
- 'Paul',
- ];
+ const arr = ['allen', 'Gustav', 'paul', 'Tim', 'abernathy', 'tucker', 'Steve', 'mike', 'John', 'Paul'];
expect(arr.sort(sortUtils.stringSortComparator)).toEqual([
'abernathy',
@@ -53,18 +42,7 @@ it('stringSortComparator() should properly sort a list of strings', () => {
it('numberSortComparator() should properly sort a list of numbers', () => {
const arr = [3, -1.1, 4, -1, 9, 4, 2, Infinity, 0, 0];
- expect(arr.sort(sortUtils.numberSortComparator)).toEqual([
- -1.1,
- -1,
- 0,
- 0,
- 2,
- 3,
- 4,
- 4,
- 9,
- Infinity,
- ]);
+ expect(arr.sort(sortUtils.numberSortComparator)).toEqual([-1.1, -1, 0, 0, 2, 3, 4, 4, 9, Infinity]);
});
it('classNameForSortDir() should return the proper asc classes', () => {
@@ -77,27 +55,28 @@ it('classNameForSortDir() should return the proper desc classes', () => {
it('getNewSortForClick() should sort to the defaultDir if new column', () => {
// no defaultDir provided
- expect(
- sortUtils.getNewSortForClick({ key: 'alpha', dir: 1 }, { name: 'beta' })
- ).toEqual({ key: 'beta', dir: 1 });
+ expect(sortUtils.getNewSortForClick({ key: 'alpha', dir: 1 }, { name: 'beta' })).toEqual({
+ key: 'beta',
+ dir: 1,
+ });
// defaultDir provided
- expect(
- sortUtils.getNewSortForClick(
- { key: 'alpha', dir: 1 },
- { name: 'beta', defaultDir: -1 }
- )
- ).toEqual({ key: 'beta', dir: -1 });
+ expect(sortUtils.getNewSortForClick({ key: 'alpha', dir: 1 }, { name: 'beta', defaultDir: -1 })).toEqual({
+ key: 'beta',
+ dir: -1,
+ });
});
it('getNewSortForClick() should toggle direction if same column', () => {
- expect(
- sortUtils.getNewSortForClick({ key: 'alpha', dir: 1 }, { name: 'alpha' })
- ).toEqual({ key: 'alpha', dir: -1 });
-
- expect(
- sortUtils.getNewSortForClick({ key: 'alpha', dir: -1 }, { name: 'alpha' })
- ).toEqual({ key: 'alpha', dir: 1 });
+ expect(sortUtils.getNewSortForClick({ key: 'alpha', dir: 1 }, { name: 'alpha' })).toEqual({
+ key: 'alpha',
+ dir: -1,
+ });
+
+ expect(sortUtils.getNewSortForClick({ key: 'alpha', dir: -1 }, { name: 'alpha' })).toEqual({
+ key: 'alpha',
+ dir: 1,
+ });
});
it('createSortClickHandler() should return a function', () => {
@@ -106,14 +85,9 @@ it('createSortClickHandler() should return a function', () => {
const currentSortDir = 1;
const updateSort = sinon.spy();
- expect(
- typeof sortUtils.createSortClickHandler(
- column,
- currentSortKey,
- currentSortDir,
- updateSort
- )
- ).toBe('function');
+ expect(typeof sortUtils.createSortClickHandler(column, currentSortKey, currentSortDir, updateSort)).toBe(
+ 'function'
+ );
});
it('createSortClickHandler() should call updateSort with the new sort vals', () => {
@@ -123,12 +97,7 @@ it('createSortClickHandler() should call updateSort with the new sort vals', ()
const currentSortDir = prevSort.dir;
const updateSort = sinon.spy();
- const clickHandler = sortUtils.createSortClickHandler(
- column,
- currentSortKey,
- currentSortDir,
- updateSort
- );
+ const clickHandler = sortUtils.createSortClickHandler(column, currentSortKey, currentSortDir, updateSort);
clickHandler();
diff --git a/yarn.lock b/yarn.lock
index aa71bb5873..48e8326b96 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -86,12 +86,6 @@ ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
-ansi-styles@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1"
- dependencies:
- color-convert "^1.0.0"
-
ansicolors@~0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.2.1.tgz#be089599097b74a5c9c4a84a0cdbcdb62bd87aef"
@@ -202,14 +196,6 @@ ast-types-flow@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
-ast-types@0.8.18:
- version "0.8.18"
- resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.18.tgz#c8b98574898e8914e9d8de74b947564a9fe929af"
-
-ast-types@0.9.4:
- version "0.9.4"
- resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.4.tgz#410d1f81890aeb8e0a38621558ba5869ae53c91b"
-
async-each@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
@@ -255,7 +241,7 @@ aws4@^1.2.1:
version "1.6.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
-babel-code-frame@6.22.0, babel-code-frame@^6.11.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
+babel-code-frame@^6.11.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
dependencies:
@@ -902,7 +888,7 @@ babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22
lodash "^4.2.0"
to-fast-properties "^1.0.1"
-babylon@6.15.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0:
+babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0:
version "6.15.0"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e"
@@ -1318,7 +1304,7 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
-color-convert@^1.0.0, color-convert@^1.3.0:
+color-convert@^1.3.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
dependencies:
@@ -1354,7 +1340,7 @@ colors@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
-colors@>=0.6.2, colors@~1.1.2:
+colors@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
@@ -2321,7 +2307,7 @@ estraverse@~4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2"
-esutils@2.0.2, esutils@^2.0.0, esutils@^2.0.2:
+esutils@^2.0.0, esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
@@ -2584,14 +2570,6 @@ flow-bin@^0.36.0:
version "0.36.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.36.0.tgz#557907bd9c2ab0670cfad9e7e906a74b0631e39a"
-flow-parser@0.40.0:
- version "0.40.0"
- resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.40.0.tgz#b3444742189093323c4319c4fe9d35391f46bcbc"
- dependencies:
- ast-types "0.8.18"
- colors ">=0.6.2"
- minimist ">=0.2.0"
-
for-in@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
@@ -2713,7 +2691,7 @@ get-caller-file@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5"
-get-stdin@5.0.1, get-stdin@^5.0.1:
+get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
@@ -2740,7 +2718,7 @@ glob-parent@^2.0.0:
dependencies:
is-glob "^2.0.0"
-glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5:
+glob@^7.0.0, glob@^7.0.3, glob@^7.0.5:
version "7.1.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
dependencies:
@@ -3507,13 +3485,6 @@ jest-matcher-utils@^18.1.0:
chalk "^1.1.3"
pretty-format "^18.1.0"
-jest-matcher-utils@^19.0.0:
- version "19.0.0"
- resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d"
- dependencies:
- chalk "^1.1.3"
- pretty-format "^19.0.0"
-
jest-matchers@^18.1.0:
version "18.1.0"
resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-18.1.0.tgz#0341484bf87a1fd0bac0a4d2c899e2b77a3f1ead"
@@ -3585,15 +3556,6 @@ jest-util@^18.1.0:
jest-mock "^18.0.0"
mkdirp "^0.5.1"
-jest-validate@19.0.0:
- version "19.0.0"
- resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173"
- dependencies:
- chalk "^1.1.1"
- jest-matcher-utils "^19.0.0"
- leven "^2.0.0"
- pretty-format "^19.0.0"
-
jest@18.1.0:
version "18.1.0"
resolved "https://registry.yarnpkg.com/jest/-/jest-18.1.0.tgz#bcebf1e203dee5c2ad2091c805300a343d9e6c7d"
@@ -3763,10 +3725,6 @@ lcid@^1.0.0:
dependencies:
invert-kv "^1.0.0"
-leven@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
-
levn@^0.3.0, levn@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
@@ -4175,7 +4133,7 @@ minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
-minimist@1.2.0, minimist@>=0.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0:
+minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
@@ -4926,20 +4884,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
-prettier@^0.22.0:
- version "0.22.0"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-0.22.0.tgz#7b37c4480d0858180407e5a8e13f0f47da7385d2"
- dependencies:
- ast-types "0.9.4"
- babel-code-frame "6.22.0"
- babylon "6.15.0"
- chalk "1.1.3"
- esutils "2.0.2"
- flow-parser "0.40.0"
- get-stdin "5.0.1"
- glob "7.1.1"
- jest-validate "19.0.0"
- minimist "1.2.0"
+prettier@^1.5.3:
+ version "1.5.3"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.5.3.tgz#59dadc683345ec6b88f88b94ed4ae7e1da394bfe"
pretty-error@^2.0.2:
version "2.0.3"
@@ -4954,12 +4901,6 @@ pretty-format@^18.1.0:
dependencies:
ansi-styles "^2.2.1"
-pretty-format@^19.0.0:
- version "19.0.0"
- resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84"
- dependencies:
- ansi-styles "^3.0.0"
-
private@^0.1.6:
version "0.1.7"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"
|