title: Azure REST API metric Collection Data JSON Issue
body: <p>When I try to collect metrics for VM using AZURE REST API for some m/c's I get metrics where data is in average and for some m/c's I get data in total please help me fix this issue , I want to get only average data for last 5mins .</p>
  
  <p>I'm using the following URL </p>
  
  <p><code>https://management.azure.com/subscriptions/{subscription_ID}/resourceGroups/rg-np-eastjp-vnet-10-198-0-0-24/providers/Microsoft.Compute/virtualMachines/vm-dev-eastjp-waf/providers/microsoft.insights/metrics?api-version=2016-09-01&amp;$filter=%28+name.value+eq+%27Network+In%27+or++name.value+eq+%27Network+Out%27+or++name.value+eq+%27Percentage+CPU%27+or++name.value+eq+%27Disk+Read+Bytes%27+or++name.value+eq+%27Disk+Write+Bytes%27+or++name.value+eq+%27Disk+Read+Operations%2FSec%27+or++name.value+eq+%27Disk+Write+Operations%2FSec%27++%29+and+timeGrain+eq+duration%27PT5M%27+and+startTime+eq+2017-12-08T12%3A58%3A41.729+and+endTime+eq+2017-12-08T13%3A03%3A41.729+</code></p>
  
  <p><a href="https://i.stack.imgur.com/5Lksw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Lksw.png" alt="Data output 1"></a>
  <a href="https://i.stack.imgur.com/x3z07.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x3z07.png" alt="Data output 2"></a></p>
  
  <p>The following is the O/P for total:</p>
  
  <pre><code>{
    "value":[
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":1791478.0
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Network In",
        "name":{
          "value":"Network In",
          "localizedValue":"Network In"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"Bytes"
      },
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":1503183.0
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Network Out",
        "name":{
          "value":"Network Out",
          "localizedValue":"Network Out"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"Bytes"
      },
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":896.99
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Percentage CPU",
        "name":{
          "value":"Percentage CPU",
          "localizedValue":"Percentage CPU"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"Percent"
      },
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":0.0
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Disk Read Bytes",
        "name":{
          "value":"Disk Read Bytes",
          "localizedValue":"Disk Read Bytes"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"Bytes"
      },
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":5022690.87
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Disk Write Bytes",
        "name":{
          "value":"Disk Write Bytes",
          "localizedValue":"Disk Write Bytes"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"Bytes"
      },
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":0.0
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Disk Read Operations/Sec",
        "name":{
          "value":"Disk Read Operations/Sec",
          "localizedValue":"Disk Read Operations/Sec"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"CountPerSecond"
      },
      {
        "data":[
          {
            "timeStamp":"2017-12-11T08:19:00Z",
            "total":10.77
          }
        ],
        "id":"/subscriptions/{subscription_ID}/resourceGroups/MWatchLab-dev-db-mcs-473968/providers/Microsoft.Compute/virtualMachines/dev-db-mcs/providers/Microsoft.Insights/metrics/Disk Write Operations/Sec",
        "name":{
          "value":"Disk Write Operations/Sec",
          "localizedValue":"Disk Write Operations/Sec"
        },
        "type":"Microsoft.Insights/metrics",
        "unit":"CountPerSecond"
      }
    ]
  }
  </code></pre>