What the metrics names on dropwizard means - dropwizard

I integrated dropwizards on my machine.
I exposed them but I am looking for information what they means.
for example how can I get the number of requests per sec? any such information is available anywhere coz I couldnt find it on the official site.
thanks.

All the "out of the box" metrics are exposed on the admin port. You can check them there. (http://localhost:<admin-port>/metrics)
For example, the number of requests can be fetched from the key: io.dropwizard.jetty.MutableServletContextHandler.requests
The ones specific to the web server, will be exposed via jetty. You will also be able to get metrics like 2xx-responses, 4xx-responses, 5xx-responses, etc.
You can always refer to this manual if you want to add your own custom ones: https://dropwizard.github.io/metrics/3.1.0/getting-started/
Here's also an article about metrics in dropwizard: http://nbsoftsolutions.com/blog/guide-and-explanation-for-metrics-in-dropwizard

It seems that vertx-dropwizard-metrics are using some customised meters. In their javadoc you can find the following:
/**
* A throughput metric, wraps a {#link Meter} object to provide a one second instant
* throughput value returned by {#link #getValue()}.
*
* #author Julien Viet
*/
For more details see this commit.
So their documentation is little out-of-date.

Related

Parameterized SAP PI Mapping

Is it possible in SAP PI parameterized mapping to get the value from a field in graphical message mapping and send that value in Java Mapping?
I have a scenario where I am getting the email list from S/4HANA system in graphical mapping but I want to use that email value in the Java Mapping which is another mapping in this scenario. I tried parameter binding but neither the import or export type of parameter is useful in this scenario since none of them can store value.
Kindly let me know if it is possible to achieve or is there any other way to get it in SAP PI system.
Not sure if parameters would be your best bet here. They are mainly intended to insert some values on configuration time into mapping at runtime.
You may want to have a look at "using global variables" like here https://blogs.sap.com/2014/10/17/how-to-use-global-variable-in-sap-pi-mapping/
One solution portrayed there is to use the "Edit Java Sections" function within graphical message mapping.
Please beware that I haven't actually tried this, so YMMV

Good way to design mqtt topic?

I am very new with mqtt design.
As I see from some tutorials in the internet, common mqtt topic has this format: /home/room/device_type/device_id
I could not see the benefit to do that. And have no idea how to use this kind of design.
From my point of view, the device (dev) might subscribe (sub) to control topic and publish (pub) to status topic. Like this:
pub: clients/dev/devid/stat
sub: clients/dev/devid/ctrl
In this way, it seems sub,pub logic is very simple for both clients and devices
Could someone please tell me some good way to design mqtt topic ?
(!) Please do not start topic with '/' (This one has been recommended by HiveMQ Team)
EDIT:
I just figured out that for whatever kind of design, the model must serve-able at least:
Individual control: send control command to a particular device.
Group control: send control command to a group of devices: type, defined group
Able to recieve the status of device.
Thank you very much
I found that the following topic split scheme works very well in multiple applications
protocol_prefix / src_id / dest_id / message_id / extra_properties
protocol_prefix is used to differentiate between different protocols / application that can be used at the same time
src_id is the ID of the mqtt client that publishes the message. It is expected to be the same as "client ID" used to connect to MQTT broker. It allows quick ACL control to check whether the client is allowed to publish specific topic.
dest_id is client ID of the "destination" unit, i.e. to whom the message is intended. Also allows quick ACL control on the broker of whether client is allowed to subscribe to a particular topic. There can be reserved "destination" strings to specify that the message is broadcasted to anyone who is interested. For example all.
message_id is actual ID of the message within used protocol. I usually use numeric value (as string of course), because the IOT or other embedded system that is connected to MQTT broker can have other I/O links and I would like to use the same protocol (but with different transport framing) to control the device using these other I/O links. I usually use numeric message IDs in such communication links.
extra_properties is an optional subtopic which can be used to communicate other MQTT specific extra information (comma separated key=value pairs for example). Good example would be reporting timestamp of the message when it was actually sent by the client. In case of "retained" messages it can help to identify the relevance of the received message. With MQTTv5 protocol that is expected to arrive soon, the need for this subtopic may disappear because there will be other way to communicate extra properties.
Hope it helps.
We have done some work on that for the domain of manufacturing (Industrial-IoT, not IoT!).
In our scenario there are lots of serverside apps of different companies communicating through MQTT. Thus we needed some overall structure. We call this "Manufacturing Message Stack".
The bottom layer is MQTT, then there is the "Messaging Layer". It consists mainly of
basic topic specs
basic payload specs
On top of the messaging layer there are domain message layers covering various domain specific topics as system messages, alerting, physical device / digital twin messages or other manufacturing related messages.
Topics
The topics are roughly defined as <senderapp>/<app-id>/<message-name>/<args> e.g. pacman/pacman-1/gameover (this is a sample for illustration only!)
The developer of an app which publishes MQTT messages defines <message-name> and <args> depending on the semantics of the payload.
The <senderapp> and <app-id> refers to the sending App and allows to quickly select messages from a defines origin (publisher). We deploy Apps in a microservice environment built with Docker, Rancher - and soon - Kubernetes.
Payload
The payload is specified in JSON format. There is a JSON schema reference URL in each
build an URL to an API of the publishing app which holds further information (e.g. JSON schema) of the message sent. Thus a subscriber can get meta data of a MQTT message on demand. Static meta data is not sent with a message to reduce the payload size.
Payload sample:
{
"$schema": "http://app/api/messages/message1.json",
"score": 1234,
"highscore": false
}
Publisher's message meta data
The publishing app holds an index of all messages which can be sent in an API at
http://<app>/api/messages/index.json:
{
"message1": "message1.json",
...
}
Each message is described by its JSON schema message1.json:
{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Pacman end of game",
"properties": {
"score": {
"description": "Players score at the end of game",
"type": "integer"
},
...
}
}
Unfortunately we did not publish our manufacturing message stack yet. Publishing is planned in the next months. Feedback is welcome.
I think if topics are to reflect the physical world, we should look at something like Signal K.
EDIT:
That spec is also still maturing, but it includes concepts like "self" for the server/broker, and a tree that can start at the current vessel/home, but easily extends upwards to other vessels/aircraft/things.
My two cents:
All topics are read-only unless they end in "/set"
Ideally, topics are reasonably normalized and granular. I can understand grouping values up into a group topic. IMHO, this kind of decision should be application-specific.
Payloads should be strings, to avoid endian-ness issues
Here's one suggested tree:
broker = information of this specific broker
broker/clients
broker/clients/count
broker/clients/0/name or broker/clients[0]/name
broker/topics
home = this current location (could also be "here" or something)
home/kitchen/temperature "19C"
home/kitchen/temperature/hardware/type "ESP8266"
home/garage/maindoor/set "closed"
locations = list of all known locations
locations/0/uuid
locations/0/name
locations/0/address

Value in code when actually code is unknow, ccd document

I am currently working on building CCD for my project.
I have a problem in code. For example let me take an example of payers section.
CONF-60:A covered party in a policy activity SHOULD contain exactly one participant / participantRole / code, to represent the reason for coverage (e.g. Self, Family dependent, student).
CONF-61:The value for “participant / participantRole / code” in a policy activity’s covered party MAY be selected from ValueSet 2.16.840.1.113883.1.11.19809 PolicyOrProgramCoverageRoleType DYNAMIC.
Above is the line i have copied from hl7 official document.
<code code="SELF" codeSystem="2.16.840.1.113883.5.111" displayName="Self"/>
Its copied from sample ccd document. Going to http://wiki.hl7.de/index.php/2.16.840.1.113883.5.111 we can see there are codes. But my system has values for which i cant find the codes there.
So my question is if cant get the codes there can i just use following and still produce a valid ccd document
<code displayName="Organ Donor"/>
In other words is it necessary to set code and code system in ccd document??
No, that particular line will not be valid and yes - It is necessary. These codes and coding systems are how other systems or programs will recognize the component. They are based in standard language meant to be recognized across EHR platforms and applications - such as LOINC (2.16.840.1.113883.6.1).
The whole purpose of the C-CDA, as the name "continuity of care" would suggest, is the seamless transition of patient information in a recognizable format to other organizations who may not utilize the same EHR.
Take a look at SMART CCDA Scorecard http://ccda-scorecard.smartplatforms.org/static/ccdaScorecard/#/
Also, what system are you using? Your system, especially for those values, should have the correct coding system because the values "SELF, MTH, FTH" are very common for documenting any demographic, insurance or patient related information. Otherwise, it might not meet the requirements of a certified EHR.
When the coding system doesn't contain an appropriate value you can use a NULL value and show the text, although usage of such is disallowed for certain elements. So your example should actually look something like this.
<code nullFlavor="OTH">
<originalText>Organ Donor</originalText>
</code>
But in general you should always try to use a valid concept code where one exists. That's the only way you'll achieve meaningful interoperability with third-party systems.

How can I specify the jvm agent id when querying the metrics on the New Relic v1 REST API?

I am trying to get JVM metrics from my application, which runs three instances, with three separate JVMs. I can see the different data that I am interested in in the New Relic dashboard, on the Monitoring -> JVMs tab. I can also get the information I want for one of those JVMs, by hitting the REST API like so:
% curl -gH "x-api-key:KEY" 'https://api.newrelic.com/api/v1/applications/APPID/data.xml?metrics%5B%5D=GC%2FPS%20Scavenge&field=time_percentage&begin=T1&end=T2'
(I've replaced the values of some fields, but this is the full form of my request.)
I get a response including a long list of elements like this:
<metric name="GC/PS Scavenge" begin="T1" end="T2" app="MYAPP" agent_id="AGENTID">
<field name="time_percentage">0.018822634485032824</field>
</metric>
All of the metric elements include the same agent_id fields, and I never specified which agent to use. How can I either:
get metrics for all agents
specify which agent I am interested in (so I can send multiple requests, one for each JVM)
agent_id can be a particular JVM instance, and while you can't request for multiple agents at once you can request metrics for a single JVM.
You can get the JVM's agent_id in one of two ways:
1) an API call to
https://api.newrelic.com/api/v1/accounts/:account_id/applications/:app_id/instances.xml
2) browse to the JVM in the New Relic user interface (use the 'JVM' drop-down at the top right after you select your app), then grab the ID from the URL.
The ID will look something like [account_id]_i2043442
Some data is not available broken down by JVM, most notably a call to threshold_values.xml won't work if the agent_id isn't an application.
full documentation of the V1 API: http://newrelic.github.io/newrelic_api/

How do I construct the cake when using Scalaxb to connect to a SOAP service?

I've read the documentation, but what I need to know is:
I'm not using a fictitious stock quote service (with an imaginary wsdl file). I'm using a different service with a different name.
Where, among the thousands and thousands of lines of code that have been generated, will I find the Scala trait(s) that I need to put together that correspond to this line in the documentation's example:
val service = (new stockquote.StockQuoteSoap12Bindings with scalaxb.SoapClients with scalaxb.DispatchHttpClients {}).service
Now, you might be thinking "Why not just search for Soap12Bindings in the generated code"? Good idea - but that turns up 0 results.
The example in the documentation is outdated, or too specific. (The documentation is also internally inconsistent and inconsistent with the actual filenames output with scalaxb.)
First, search for SoapBindings instead of Soap12Bindings to find the service-specific trait (the first trait).
Then, instead of scalaxb.SoapClients, use scalaxb.Soap11Clients.

Resources