-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/translate monitoring apm and chart #25063
Merged
maryia-lapata
merged 28 commits into
elastic:master
from
Nox911:feature/translate-monitoring-apm
Nov 23, 2018
Merged
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c7ec189
Merge pull request #1 from elastic/master
Nox911 fa01b88
Merge pull request #2 from elastic/master
Nox911 70f6c7e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 68587a0
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 42aa7d3
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 efeaefe
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 8a054ed
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 b0d1660
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 62b6ad1
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 acbad4b
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 a850650
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 0a200ce
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 b2a8244
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 b4b979e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 d349a4f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 ae285b9
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 caa31d5
Translate monitoring - apm
Nox911 7399eef
Translate monitoring - chart
Nox911 db01d31
Fix issues with apm
Nox911 bce30ed
Fix issues with chart
Nox911 3051641
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 7070140
Update snapshots
Nox911 6231971
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 cb91611
Merge branch 'master' into feature/translate-monitoring-apm
Nox911 01d4a1d
Merge branch 'master' into feature/translate-monitoring-apm
maryia-lapata 5e0e6de
Merge branch 'master' into feature/translate-monitoring-apm
maryia-lapata 81df60e
Merge branch 'master' into feature/translate-monitoring-apm
maryia-lapata 5e66b95
Merge branch 'master' into feature/translate-monitoring-apm
maryia-lapata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -10,8 +10,10 @@ import { SummaryStatus } from '../../summary_status'; | |
import { ApmStatusIcon } from '../status_icon'; | ||
import { formatMetric } from '../../../lib/format_number'; | ||
import { formatTimestampToDuration } from '../../../../common'; | ||
import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; | ||
import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; | ||
|
||
export function Status({ stats }) { | ||
function StatusUI({ stats, intl }) { | ||
const { | ||
apms: { | ||
total | ||
|
@@ -22,25 +24,46 @@ export function Status({ stats }) { | |
|
||
const metrics = [ | ||
{ | ||
label: 'Servers', | ||
label: intl.formatMessage({ | ||
id: 'xpack.monitoring.apm.instances.status.serversLabel', | ||
defaultMessage: 'Servers', | ||
}), | ||
value: total, | ||
dataTestSubj: 'total' | ||
}, | ||
{ | ||
label: 'Total Events', | ||
label: intl.formatMessage({ | ||
id: 'xpack.monitoring.apm.instances.status.totalEventsLabel', | ||
defaultMessage: 'Total Events', | ||
}), | ||
value: formatMetric(totalEvents, '0.[0]a'), | ||
dataTestSubj: 'totalEvents' | ||
}, | ||
{ | ||
label: 'Last Event', | ||
value: formatTimestampToDuration(+moment(timeOfLastEvent), 'since') + ' ago', | ||
label: intl.formatMessage({ | ||
id: 'xpack.monitoring.apm.instances.status.lastEventLabel', | ||
defaultMessage: 'Last Event', | ||
}), | ||
value: intl.formatMessage({ | ||
id: 'xpack.monitoring.apm.instances.status.lastEventDescription', | ||
defaultMessage: '{timeOfLastEvent} ago' }, { | ||
timeOfLastEvent: formatTimestampToDuration(+moment(timeOfLastEvent), CALCULATE_DURATION_SINCE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again here, missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
}), | ||
dataTestSubj: 'timeOfLastEvent', | ||
} | ||
]; | ||
|
||
const IconComponent = ({ status }) => ( | ||
<Fragment> | ||
Status: <ApmStatusIcon status={status} /> | ||
<FormattedMessage | ||
id="xpack.monitoring.apm.instances.statusDescription" | ||
defaultMessage="Status: {apmStatusIcon}" | ||
values={{ | ||
apmStatusIcon: ( | ||
<ApmStatusIcon status={status} /> | ||
) | ||
}} | ||
/> | ||
</Fragment> | ||
); | ||
|
||
|
@@ -52,3 +75,5 @@ export function Status({ stats }) { | |
/> | ||
); | ||
} | ||
|
||
export const Status = injectI18n(StatusUI); |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
'since'
argumentThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'since' it's not a label, it's a kind of key, which is passed as a parameter to function formatTimestampToDuration() . And according to this key
timeDuration
is calculated differently. So we didn't miss'since'
argument, we just replaced it with a constant like in the other code:https://github.com/elastic/kibana/blob/master/x-pack/plugins/monitoring/public/components/cluster/overview/alerts_panel.js#L39
https://github.com/elastic/kibana/blob/master/x-pack/plugins/monitoring/public/directives/alerts/index.js#L50
Please correct me if I am wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes you're right!