intelsdi-x / snap-plugin-collector-disk

Collects Linux disk metrics from /proc/diskstats
http://snap-telemetry.io/
Apache License 2.0
4 stars 23 forks source link

Added exemplary task manifest with specified disk #37

Closed IzabellaRaulin closed 7 years ago

IzabellaRaulin commented 7 years ago

Fixes https://github.com/intelsdi-x/snap-plugin-collector-disk/issues/12

Summary of changes:

How to verify it:

Example:

  1. load snap-plugin-collector-disk:

    snaptel plugin load snaptel plugin load ./build/linux/x86_64/snap-plugin-collector-disk
  2. create task manifest with a specified dynamic element (disk), see examples/tasks/:

    
    "version": 1,
    "schedule": {
    "type": "simple",
    "interval": "1s"
    },
    "workflow": {
    "collect": {
      "metrics": {
        "/intel/procfs/disk/sda/*": {}
      },
      "config": {
        "/intel/procfs/disk": {
          "proc_path": "/proc"
        }
      },
      "process": null,
      "publish": [
        {
          "plugin_name": "file",
          "config": {
            "file": "/tmp/published_diskstats_sda.log"
          }
        }
      ]
    }
    }
    }
  3. load a declared publisher: snap-plugin-publisher-file:

    snaptel plugin load snaptel plugin load <path-to-snap-plugin-publisher-file>
  4. create a task:

    
    $ snaptel task create -t  examples/tasks/disk_sda-file.json

Using task manifest to create task Task created ID: 72166b3e-4236-46ef-89f1-a9088441f113 Name: Task-72166b3e-4236-46ef-89f1-a9088441f113 State: Running


5. watch collected metrics:
(notice, that they come only from specified disk `sda`)

$ snaptel task watch 72166b3e-4236-46ef-89f1-a9088441f113

NAMESPACE DATA TIMESTAMP /intel/procfs/disk/sda/io_time 0 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/merged_read 0 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/merged_write 7.982935636867953 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/octets_read 0 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/octets_write 57221.68264506949 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/ops_read 0 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/ops_write 7.982935636867953 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/pending_ops 0 2016-12-05 12:44:17.94398502 +0100 CET /intel/procfs/disk/sda/weighted_io_time 0 2016-12-05 12:44:17.94398502 +0100 CET