-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from sendilkumarn/settings
Adds Metrics Page
- Loading branch information
Showing
6 changed files
with
507 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ient/templates/src/main/webapp/app/modules/administration/metrics/metrics-detail/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const MetricsRoute = { | ||
path: 'admin/metrics-detail', | ||
getComponent(nextState, cb) { | ||
require.ensure([], (require) => { | ||
cb(null, require('./metrics-detail')); | ||
}); | ||
} | ||
}; |
44 changes: 44 additions & 0 deletions
44
...lates/src/main/webapp/app/modules/administration/metrics/metrics-detail/metrics-detail.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { hashHistory } from 'react-router'; | ||
|
||
import MetricsModal from './metrics-modal'; | ||
|
||
export class Metrics extends Component { | ||
|
||
static propTypes = { | ||
isAuthenticated: PropTypes.bool.isRequired | ||
}; | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
showModal: false | ||
}; | ||
} | ||
|
||
componentWillMount() { | ||
this.setState({ | ||
showModal: true | ||
}); | ||
} | ||
|
||
componentWillReceiveProps(nextProps) { | ||
this.setState({ | ||
showModal: !nextProps.isAuthenticated | ||
}); | ||
} | ||
|
||
handleClose = () => { | ||
this.setState({ showModal: false }); | ||
hashHistory.push('/admin/metrics'); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<MetricsModal showModal={this.state.showModal} handleClose={this.handleClose} threadDump={this.props.threadDump} /> | ||
); | ||
} | ||
} | ||
|
||
export default connect(({ administration }) => ({ threadDump: administration.threadDump, isFetching: administration.isFetching }))(Metrics); |
90 changes: 90 additions & 0 deletions
90
...plates/src/main/webapp/app/modules/administration/metrics/metrics-detail/metrics-modal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import Dialog from 'material-ui/Dialog'; | ||
import FlatButton from 'material-ui/FlatButton'; | ||
import Translate from 'react-translate-component'; | ||
|
||
import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; | ||
|
||
class MetricsModal extends Component { | ||
|
||
static propTypes = { | ||
handleClose: PropTypes.func.isRequired, | ||
showModal: PropTypes.bool.isRequired | ||
}; | ||
|
||
constructor(props, context) { | ||
super(props, context); | ||
} | ||
|
||
render() { | ||
const { handleClose, threadDump } = this.props; | ||
const showCheckboxes = false; | ||
// FIX show / hide stacktrace function & filter & Labels | ||
const actions = [ | ||
<FlatButton | ||
label={<Translate content="entity.action.cancel" />} | ||
onTouchTap={handleClose} | ||
/> | ||
]; | ||
return ( | ||
<Dialog | ||
title={<h3><Translate content="metrics.title" /></h3>} | ||
actions={actions} | ||
modal autoScrollBodyContent | ||
open={this.props.showModal} | ||
onRequestClose={handleClose} | ||
> | ||
<div className="container"> | ||
{threadDump.map(threadDumpInfo => ( | ||
<div> | ||
<h5>{threadDumpInfo.threadState} {threadDumpInfo.threadName} (ID {threadDumpInfo.threadId})</h5> | ||
<FlatButton | ||
label="Show StackTrace" | ||
onTouchTap={() => this.setState({ showStack: !this.state.showStack })} | ||
/> | ||
<div className="row" > | ||
<div className="col-md-12"> | ||
{Object.keys(threadDumpInfo.stackTrace).map((stK, stV) => ( | ||
<p> | ||
{threadDumpInfo.stackTrace[stK].className}.{threadDumpInfo.stackTrace[stK].methodName} | ||
({threadDumpInfo.stackTrace[stK].fileName}:{threadDumpInfo.stackTrace[stK].lineNumber}) | ||
</p> | ||
))} | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-md-12"> | ||
<Table> | ||
<TableHeader | ||
displaySelectAll={showCheckboxes} | ||
adjustForCheckbox={showCheckboxes} | ||
> | ||
<TableRow> | ||
<TableHeaderColumn>Blocked Time</TableHeaderColumn> | ||
<TableHeaderColumn>Blocked Count</TableHeaderColumn> | ||
<TableHeaderColumn>Waited Time</TableHeaderColumn> | ||
<TableHeaderColumn>Waited Count</TableHeaderColumn> | ||
<TableHeaderColumn>Lock Name</TableHeaderColumn> | ||
</TableRow> | ||
</TableHeader> | ||
<TableBody displayRowCheckbox={showCheckboxes}> | ||
<TableRow key={threadDumpInfo}> | ||
<TableRowColumn>{threadDumpInfo.blockedTime}</TableRowColumn> | ||
<TableRowColumn>{threadDumpInfo.blockedCount}</TableRowColumn> | ||
<TableRowColumn>{threadDumpInfo.waitedTime}</TableRowColumn> | ||
<TableRowColumn>{threadDumpInfo.waitedCount}</TableRowColumn> | ||
<TableRowColumn>{threadDumpInfo.lockName}</TableRowColumn> | ||
</TableRow> | ||
</TableBody> | ||
</Table> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</Dialog> | ||
); | ||
} | ||
} | ||
|
||
export default MetricsModal; |
Oops, something went wrong.