Skip to content

Commit

Permalink
Add a Log tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed Nov 25, 2016
1 parent bf265d6 commit 1b03c75
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/components/ProfileViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ProfileSummaryView from '../containers/ProfileSummaryView';
import ProfileCallTreeView from '../containers/ProfileCallTreeView';
import ProfileMarkersView from '../containers/ProfileMarkersView';
import ProfileTaskTracerView from '../containers/ProfileTaskTracerView';
import ProfileLogView from '../containers/ProfileLogView';
import ProfileThreadJankTimeline from '../containers/ProfileThreadJankTimeline';
import ProfileThreadTracingMarkerTimeline from '../containers/ProfileThreadTracingMarkerTimeline';
import ProfileFilterNavigator from '../containers/ProfileFilterNavigator';
Expand Down Expand Up @@ -38,6 +39,10 @@ class ProfileViewer extends Component {
name: 'tasktracer',
title: 'Task Tracer',
},
{
name: 'log',
title: 'Log',
},
];
}

Expand Down Expand Up @@ -137,6 +142,7 @@ class ProfileViewer extends Component {
calltree: <ProfileCallTreeView params={params} location={location} />,
markers: <ProfileMarkersView params={params} location={location} />,
tasktracer: <ProfileTaskTracerView params={params} location={location} rangeStart={timeRange.start} rangeEnd={timeRange.end} />,
log: <ProfileLogView params={params} location={location} />,
}[selectedTab]}

</div>
Expand Down
33 changes: 33 additions & 0 deletions src/containers/ProfileLogView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { selectedThreadSelectors } from '../selectors/';
import * as actions from '../actions';

class ProfileLogView extends Component {
render() {
const { thread } = this.props;
const { markers, stringTable } = thread;
return (
<div className='logViewWrapper'>
<pre className='logViewPre'>
{
markers.data.map((data, markerIndex) => markerIndex).filter(markerIndex => {
const data = markers.data[markerIndex];
return data !== null && ('category' in data) && data.category === 'log';
}).map(markerIndex => {
return stringTable.getString(markers.name[markerIndex]);
}).join('')
}
</pre>
</div>
);
}
}

ProfileLogView.propTypes = {
thread: PropTypes.object.isRequired,
};

export default connect((state, props) => ({
thread: selectedThreadSelectors.getRangeSelectionFilteredThread(state, props),
}), actions)(ProfileLogView);
2 changes: 1 addition & 1 deletion src/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function zeroAt(state = 0, action) {
}
}

function tabOrder(state = [0, 1, 2, 3], action) {
function tabOrder(state = [0, 1, 2, 3, 4], action) {
switch (action.type) {
case 'CHANGE_TAB_ORDER':
return action.tabOrder;
Expand Down
11 changes: 10 additions & 1 deletion static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,22 @@ body, #root, .profileViewer {
flex-flow: row nowrap;
}

.taskTracerViewWrapper {
.taskTracerViewWrapper,
.logViewWrapper {
border-top: 1px solid #D6D6D6;
flex: 1;
overflow: auto;
position: relative;
}

.logViewPre {
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 10px;
}

.taskTracerView {
position: absolute;
top: 0;
Expand Down

0 comments on commit 1b03c75

Please sign in to comment.