[ 
https://issues.apache.org/jira/browse/STORM-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14014800#comment-14014800
 ] 

ASF GitHub Bot commented on STORM-205:
--------------------------------------

Github user d2r commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/101#discussion_r13263218
  
    --- Diff: storm-core/src/clj/backtype/storm/ui/core.clj ---
    @@ -644,11 +304,153 @@
       [:input {:type "button"
                :value action
                (if enabled :enabled :disabled) ""
    -           :onclick (str "confirmAction('" 
    -                         (StringEscapeUtils/escapeJavaScript id) "', '" 
    +           :onclick (str "confirmAction('"
    +                         (StringEscapeUtils/escapeJavaScript id) "', '"
                              (StringEscapeUtils/escapeJavaScript name) "', '"
                              command "', " is-wait ", " default-wait ")")}])
     
    +(defn cluster-configuration []
    +  (with-nimbus nimbus
    +    (.getNimbusConf ^Nimbus$Client nimbus)))
    +
    +(defn cluster-summary
    +  ([]
    +     (with-nimbus nimbus
    +        (cluster-summary (.getClusterInfo ^Nimbus$Client nimbus))))
    +  ([^ClusterSummary summ]
    +     (let [sups (.get_supervisors summ)
    +        used-slots (reduce + (map #(.get_num_used_workers 
^SupervisorSummary %) sups))
    +        total-slots (reduce + (map #(.get_num_workers ^SupervisorSummary 
%) sups))
    +        free-slots (- total-slots used-slots)
    +        total-tasks (->> (.get_topologies summ)
    +                         (map #(.get_num_tasks ^TopologySummary %))
    +                         (reduce +))
    +        total-executors (->> (.get_topologies summ)
    +                             (map #(.get_num_executors ^TopologySummary %))
    +                             (reduce +))]
    +       { "stormVersion" (read-storm-version)
    +         "nimbusUptime" (pretty-uptime-sec (.get_nimbus_uptime_secs summ))
    +         "supervisors" (count sups)
    +         "topologies" ""
    --- End diff --
    
    Looks like topologies is always blank with /api/v1/cluster/summary


> Add REST API to Storm UI
> ------------------------
>
>                 Key: STORM-205
>                 URL: https://issues.apache.org/jira/browse/STORM-205
>             Project: Apache Storm (Incubating)
>          Issue Type: New Feature
>            Reporter: P. Taylor Goetz
>
> It would be helpful to have a RESTful API to expose the metrics currently 
> available in Storm UI.
> This would allow integration with 3rd-party monitoring and visualization 
> services.
> The REST services could either be implemented within the Storm UI service, or 
> as a separate Storm daemon.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to