-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: parse response by xml path in http collect #5
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
base: master
Are you sure you want to change the base?
Changes from all commits
4d31312
3da4419
8e36967
db9fffc
81ad231
eaba224
d303881
7452bcf
a61a318
eb24526
7c6c3ba
6f283ef
a03c9cc
b523e85
31aa6c9
874a3a2
62cd16e
4b8f7b8
5c9b65a
6a7be94
cdd6504
ce73683
bc019b1
afc8926
225157a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,6 +172,56 @@ metrics: | |
parseType: jsonPath | ||
parseScript: '$.availableTags[?(@.tag == "state")].values[*]' | ||
|
||
- name: status | ||
i18n: | ||
zh-CN: 状态 | ||
en-US: Status | ||
priority: 6 | ||
fields: | ||
- field: activeThreads | ||
i18n: | ||
zh-CN: 活跃线程数 | ||
en-US: Active Threads | ||
type: 0 | ||
- field: inactiveThreads | ||
i18n: | ||
zh-CN: 非活跃线程数 | ||
en-US: Inactive Threads | ||
type: 0 | ||
- field: usedMemory | ||
i18n: | ||
zh-CN: 已用内存 | ||
en-US: Used Memory | ||
type: 0 | ||
unit: MB | ||
- field: totalMemory | ||
i18n: | ||
zh-CN: 总内存 | ||
en-US: Total Memory | ||
type: 0 | ||
unit: MB | ||
protocol: http | ||
http: | ||
host: ^_^host^_^ | ||
port: ^_^port^_^ | ||
url: ^_^base_path^_^/metrics/status.xml | ||
method: GET | ||
ssl: ^_^ssl^_^ | ||
authorization: | ||
type: Basic Auth | ||
basicAuthUsername: ^_^username^_^ | ||
basicAuthPassword: ^_^password^_^ | ||
parseType: xmlPath | ||
parseScript: | ||
- alias: activeThreads | ||
path: /status/threads/active | ||
- alias: inactiveThreads | ||
path: /status/threads/inactive | ||
- alias: usedMemory | ||
path: /status/memory/used | ||
- alias: totalMemory | ||
path: /status/memory/total | ||
Comment on lines
+215
to
+223
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. The |
||
|
||
- name: threads | ||
i18n: | ||
zh-CN: 线程 | ||
|
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.
Consider catching specific exceptions instead of a general
Exception
to provide more informative error messages and handle different error scenarios appropriately. For example,SAXException
orIOException
could be caught separately to provide specific error messages related to XML parsing or IO issues.