Andrii Tkach created AMBARI-10373:
-------------------------------------

             Summary: Create widget wizard: Implement metrics selection and 
expression formation on "Metrics and Expression" page
                 Key: AMBARI-10373
                 URL: https://issues.apache.org/jira/browse/AMBARI-10373
             Project: Ambari
          Issue Type: Task
          Components: ambari-web
    Affects Versions: 2.1.0
            Reporter: Andrii Tkach
            Assignee: Andrii Tkach
             Fix For: 2.1.0


Tasks that needs to be done as part of this ticket:
# Create model for Metrics. Attributes to capture in the model is name, 
widget_id, service_name, component_name, type, temporal, pointInTime and level. 
All of these are available from API response 
{code}
{
  "href" : 
"http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services?artifacts/Artifacts/artifact_name=metrics_descriptor&StackServices/service_name.in(HDFS,HBASE,YARN)&fields=artifacts/*",
  "items" : [
    {
      "href" : 
"http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/HBASE";,
      "StackServices" : {
        "service_name" : "HBASE",
        "stack_name" : "HDP",
        "stack_version" : "2.2"
      },
      "artifacts" : [
        {
          "href" : 
"http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/HBASE/artifacts/metrics_descriptor";,
          "Artifacts" : {
            "artifact_name" : "metrics_descriptor",
            "service_name" : "HBASE",
            "stack_name" : "HDP",
            "stack_version" : "2.2"
          },
          "artifact_data" : {
            "HBASE" : {
              "HBASE_CLIENT" : {
                "Component" : [
                  {
                    "type" : "ganglia",
                    "properties" : null,
                    "metrics" : {
                      "default" : {
                        "metrics/rpc/closeRegion_num_ops" : {
                          "pointInTime" : true,
                          "temporal" : true,
                          "name" : "rpc.rpc.closeRegion_num_ops"
                        },
{code}
{code}App.Metrics = DS.Model.extend({
widget_id: DS.attr('string'), //example: "metrics/rpc/closeRegion_num_ops",
name: DS.attr('string'),       //example: "rpc.rpc.closeRegion_num_ops",
pointInTime: true,
temporal: true,
category: DS.attr('string'),                 //example: default
serviceName: DS.attr('string'),          //example: HBASE
componentName: DS.attr('string'),    //example: HBASE_CLIENT
type: DS.attr('string'),                        //options: GANGLIA | JMX
level: DS.attr('string'),                       //options: COMPONENT | 
HOSTCOMPONENT
}){code}
#  On transition from step-1 "Choose Type" to "Metrics & Expression" page, map 
Metrics model from API response of following call 
{code}/api/v1/stacks/HDP/versions/2.2/services?artifacts/Artifacts/artifact_name=metrics_descriptor&StackServices/service_name.in(HDFS,HBASE,YARN)&fields=artifacts/*{code}.
 *NOTE: Replace HDFS,HBASE, YARN in the above call with the names of all 
installed services in the cluster. This API call is implemented in the backend 
and is currently working on the current trunk bits.

NOTE: This task needs to be implemented for GAUGE, NUMBER and GRAPH widget 
type. Achieving this for TEMPLATE widget type will be achieved in a seperate 
task



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to