[gnome-battery-bench] Add an id (UUID) to each test run
- From: Christian Kellner <gicmo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-battery-bench] Add an id (UUID) to each test run
- Date: Mon, 13 Mar 2017 18:20:58 +0000 (UTC)
commit a1fe2296bf5c923d45e8df7a0d616d7c6a3152f5
Author: Christian Kellner <gicmo gnome org>
Date: Mon Mar 13 17:57:36 2017 +0100
Add an id (UUID) to each test run
That will make it easy to globally identify runs, which might come
in handy especially if we synchronize runs into a central database.
src/test-run.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/test-run.c b/src/test-run.c
index 751c16d..b00eb88 100644
--- a/src/test-run.c
+++ b/src/test-run.c
@@ -14,6 +14,7 @@ struct _GbbTestRun {
GObject parent;
GbbBatteryTest *test;
+ char *id;
char *filename;
char *name;
char *description;
@@ -63,6 +64,7 @@ gbb_test_run_finalize(GObject *object)
static void
gbb_test_run_init(GbbTestRun *run)
{
+ run->id = uuid_gen_new();
run->history = g_queue_new();
}
@@ -310,6 +312,8 @@ gbb_test_run_write_to_file(GbbTestRun *run,
JsonBuilder *builder = json_builder_new();
json_builder_begin_object(builder);
+ json_builder_set_member_name(builder, "id");
+ json_builder_add_string_value(builder, run->id);
json_builder_set_member_name(builder, "test-id");
json_builder_add_string_value(builder, run->test->id);
json_builder_set_member_name(builder, "test-name");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]