apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Farkas <...@datatorrent.com>
Subject Re: Visualize custom metrics in the dashboard
Date Thu, 03 Sep 2015 04:14:31 GMT
Hi Ilya,

I believe the overall approach is correct. Is {"type":"data",
"topic":"c1.citadel.latencies", "data":[{"Elapsed":"3987"}, {"Max
(30s)":"3987ms"}, {"Avg (30s)":"257.00ms"}, {"Msgs/sec":"48"}]} the JSON
that you are seeing output by the PubSubWebsocketOutputOperator? Also is
the receiver of the message sending a {"type":"subscribe",
"topic":"c1.citadel.latencies"} message?

A quick way to debug whether your messages can be sent or received properly
is to use Simple Websocket
https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo?hl=en

-You can use it to connect to ws://your.gateway/pubsub
-Then enter {"type":"subscribe", "topic":"c1.citadel.latencies"}
-Then enter  {"type":"data", "topic":"c1.citadel.latencies",
"data":[{"Elapsed":"3987"},
{"Max (30s)":"3987ms"}, {"Avg (30s)":"257.00ms"} This will not echo the
result back to you
- If you enter  {"type":"publish", "topic":"c1.citadel.latencies",
"data":[{"Elapsed":"3987"},
{"Max (30s)":"3987ms"}, {"Avg (30s)":"257.00ms"} This will echo the result
back to you

Note that if you have a fresh connection and you don't send the subscribe
message, you will not get the result echoed back to you.

There is an easier way. Datatorrent already has operators which serve data
to the UI and Widgets which display the data in the UI, but that is in the
Enterprise edition.

Hope this helps, please keep us posted
Tim

On Wed, Sep 2, 2015 at 8:17 PM, Ganelin, Ilya <Ilya.Ganelin@capitalone.com>
wrote:

> Hi Timothy - the idea was to surface our own metrics to the DataTorrent
> UI. We have been rolling with this approach since it was recommended to us
> by DT folks. Is there a better way to visualize metrics in the UI?
>
>
>
> Thank you,
> Ilya Ganelin
>
>
>
> -----Original Message-----
> From: Timothy Farkas [tim@datatorrent.com<mailto:tim@datatorrent.com>]
> Sent: Wednesday, September 02, 2015 10:24 PM Eastern Standard Time
> To: dev@apex.incubator.apache.org
> Subject: Re: Visualize custom metrics in the dashboard
>
>
> Hi Ilya,
>
> It looks like you are using Gateway as your websocket server. The protocol
> to send messages to gateway is to use "publish" as you "type" not "data".
> Also whoever is receiving data from the gateway needs to send a subscribe
> message like this to gateway first {"type":"subscribe","topic":"myTopic"},
> before they will receive any data from a topic.
>
> Tim
>
> On Wed, Sep 2, 2015 at 6:18 PM, Ganelin, Ilya <Ilya.Ganelin@capitalone.com
> >
> wrote:
>
> > Chetan, thanks! I fixed that error, and validated the JSON shown below,
> > any further ideas?
> >
> > {"type":"data", "topic":"c1.citadel.latencies",
> > "data":[{"Elapsed":"3987"}, {"Max (30s)":"3987ms"}, {"Avg
> > (30s)":"257.00ms"}, {"Msgs/sec":"48"}]}
> >
> > On 9/2/15, 12:28 PM, "Chetan Narsude" <chetan@datatorrent.com> wrote:
> >
> > >On Wed, Sep 2, 2015 at 10:47 AM, Ganelin, Ilya
> > ><Ilya.Ganelin@capitalone.com>
> > >wrote:
> > >
> > >> Hi all ­ I¹m attempting to surface some output directly to the
> existing
> > >> Apex dashboard. Based on the Twitter example here:
> > >>
> > >>
> > >>
> >
> https://github.com/DataTorrent/Malhar/blob/release-2.0.0/demos/twitter/sr
> >
> >>c/main/java/com/datatorrent/demos/twitter/TwitterTrendingHashtagsApplicat
> > >>ion.java
> > >> [snip]
> > >>
> > >>
> > >> An example of the JSON object I¹m outputting is below:
> > >> {"type":"data", "topic":"test1", "data":["Elapsed":"1234", "Max
> > >> (30s)":"5678ms", "Avg (30s)":*"2000.00"ms*, "Msgs/sec":"5000"]}
> > >>
> > >>
> > >The highlighted portion (*"2000.00"ms*) above looks pretty wrong to me
> :-)
> > >
> > >--
> > >Chetan
> > >
> > >
> > >
> > >>
> > >> Any thoughts on what¹s going on here or how I can debug this? The job
> > >>does
> > >> not ever appear to even launch. Thanks!
> > >> ________________________________________________________
> > >>
> > >> The information contained in this e-mail is confidential and/or
> > >> proprietary to Capital One and/or its affiliates and may only be used
> > >> solely in performance of work or services for Capital One. The
> > >>information
> > >> transmitted herewith is intended only for use by the individual or
> > >>entity
> > >> to which it is addressed. If the reader of this message is not the
> > >>intended
> > >> recipient, you are hereby notified that any review, retransmission,
> > >> dissemination, distribution, copying or other use of, or taking of any
> > >> action in reliance upon this information is strictly prohibited. If
> you
> > >> have received this communication in error, please contact the sender
> and
> > >> delete the material from your computer.
> > >>
> >
> > ________________________________________________________
> >
> > The information contained in this e-mail is confidential and/or
> > proprietary to Capital One and/or its affiliates and may only be used
> > solely in performance of work or services for Capital One. The
> information
> > transmitted herewith is intended only for use by the individual or entity
> > to which it is addressed. If the reader of this message is not the
> intended
> > recipient, you are hereby notified that any review, retransmission,
> > dissemination, distribution, copying or other use of, or taking of any
> > action in reliance upon this information is strictly prohibited. If you
> > have received this communication in error, please contact the sender and
> > delete the material from your computer.
> >
> >
> ________________________________________________________
>
> The information contained in this e-mail is confidential and/or
> proprietary to Capital One and/or its affiliates and may only be used
> solely in performance of work or services for Capital One. The information
> transmitted herewith is intended only for use by the individual or entity
> to which it is addressed. If the reader of this message is not the intended
> recipient, you are hereby notified that any review, retransmission,
> dissemination, distribution, copying or other use of, or taking of any
> action in reliance upon this information is strictly prohibited. If you
> have received this communication in error, please contact the sender and
> delete the material from your computer.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message