[v4,11/11] examples/power: add json example files

Message ID 20180926134037.43606-12-david.hunt@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series add json power policy interface for containers |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hunt, David Sept. 26, 2018, 1:40 p.m. UTC
  This patch provides some example files in the json_examples sub-directory
for sending to the fifo.

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 examples/vm_power_manager/json_examples/README            | 6 ++++++
 examples/vm_power_manager/json_examples/create.json       | 8 ++++++++
 examples/vm_power_manager/json_examples/destroy.json      | 4 ++++
 examples/vm_power_manager/json_examples/set_core_max.json | 6 ++++++
 examples/vm_power_manager/json_examples/set_core_min.json | 6 ++++++
 5 files changed, 30 insertions(+)
 create mode 100644 examples/vm_power_manager/json_examples/README
 create mode 100644 examples/vm_power_manager/json_examples/create.json
 create mode 100644 examples/vm_power_manager/json_examples/destroy.json
 create mode 100644 examples/vm_power_manager/json_examples/set_core_max.json
 create mode 100644 examples/vm_power_manager/json_examples/set_core_min.json
  

Comments

Kovacevic, Marko Sept. 26, 2018, 3:58 p.m. UTC | #1
Hi Dave,

Feel like this part is not needed in the patch as you have this already in the documentation,
People can just copy and paste the examples from the docs, so we don't need to maintain two things.

Thanks,
Marko K.
  
Hunt, David Sept. 26, 2018, 4:14 p.m. UTC | #2
Good point. There's also a couple of tiny niggles I'd like to resolve in patch 10 of the set, so I'll re-spin in v5.

-----Original Message-----
From: Kovacevic, Marko 
Sent: Wednesday, 26 September, 2018 4:58 PM
To: Hunt, David <david.hunt@intel.com>; dev@dpdk.org
Cc: Mcnamara, John <john.mcnamara@intel.com>; stephen@networkplumber.org; Yao, Lei A <lei.a.yao@intel.com>; Burakov, Anatoly <anatoly.burakov@intel.com>; Hunt, David <david.hunt@intel.com>
Subject: RE: [dpdk-dev] [PATCH v4 11/11] examples/power: add json example files

Hi Dave,

Feel like this part is not needed in the patch as you have this already in the documentation, People can just copy and paste the examples from the docs, so we don't need to maintain two things.

Thanks,
Marko K.
  

Patch

diff --git a/examples/vm_power_manager/json_examples/README b/examples/vm_power_manager/json_examples/README
new file mode 100644
index 000000000..0c68bf913
--- /dev/null
+++ b/examples/vm_power_manager/json_examples/README
@@ -0,0 +1,6 @@ 
+Sample files for sending to the vm_power_manager through the fifo.
+
+Simply cat the file to /tmp/powermonitor/fifo when the vm_power_manager
+application is running.
+
+E.g. cat create.json >/tmp/powermonitor/fifo
diff --git a/examples/vm_power_manager/json_examples/create.json b/examples/vm_power_manager/json_examples/create.json
new file mode 100644
index 000000000..a7133d9a1
--- /dev/null
+++ b/examples/vm_power_manager/json_examples/create.json
@@ -0,0 +1,8 @@ 
+{"policy": {
+  "name": "policy-1",
+  "command": "create",
+  "policy_type": "TIME",
+  "busy_hours":[ 17, 18, 19, 20, 21, 22, 23 ],
+  "quiet_hours":[ 2, 3, 4, 5, 6 ],
+  "core_list":[ 11, 12 ]
+}}
diff --git a/examples/vm_power_manager/json_examples/destroy.json b/examples/vm_power_manager/json_examples/destroy.json
new file mode 100644
index 000000000..587c9e7e9
--- /dev/null
+++ b/examples/vm_power_manager/json_examples/destroy.json
@@ -0,0 +1,4 @@ 
+{"policy": {
+  "name": "policy-1",
+  "command": "destroy"
+}}
diff --git a/examples/vm_power_manager/json_examples/set_core_max.json b/examples/vm_power_manager/json_examples/set_core_max.json
new file mode 100644
index 000000000..497030a44
--- /dev/null
+++ b/examples/vm_power_manager/json_examples/set_core_max.json
@@ -0,0 +1,6 @@ 
+{"instruction": {
+  "name": "set_power",
+  "command": "power",
+  "unit": "SCALE_MAX",
+  "resource_id": 10
+}}
diff --git a/examples/vm_power_manager/json_examples/set_core_min.json b/examples/vm_power_manager/json_examples/set_core_min.json
new file mode 100644
index 000000000..76d934fd8
--- /dev/null
+++ b/examples/vm_power_manager/json_examples/set_core_min.json
@@ -0,0 +1,6 @@ 
+{"instruction": {
+  "name": "set_power",
+  "command": "power",
+  "unit": "SCALE_MIN",
+  "resource_id": 10
+}}