From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f228.google.com (mail-qk0-f228.google.com [209.85.220.228]) by dpdk.org (Postfix) with ESMTP id 4B6877272 for ; Thu, 29 Mar 2018 21:16:47 +0200 (CEST) Received: by mail-qk0-f228.google.com with SMTP id s78so7096072qkl.8 for ; Thu, 29 Mar 2018 12:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=n9e0Xt1u0MMYj86+2iYBnFxj2fvfcAFhIR6UCEPinyU=; b=LDrQgEn1GJ4HAnpUq/LJ1lnfePsUpfJpuE2e9eEBY7fKvYR8smaWMbBFwpy50gmjiD PyI2TMtjBpDyFnzFFzekIdw35Uwp29EOVoQ89E/DhskTl0RFwVZXGsGbYHuEQ4YIuqnA o5VXDHG1SHcgbw6pVQbBuLPEJ5tM4lH47ZL0I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=n9e0Xt1u0MMYj86+2iYBnFxj2fvfcAFhIR6UCEPinyU=; b=UkYJ/1lnEytdL2tbkb2EQC0Fv6LSTfjy3j2XKtOmP/ladGZKnx0mo0yOF4WNb6XSOJ 1GXZhygKwYjJZn6Fv0udGHRa7k+/z8YPFWagABLOwPlcHaATilIVdeliAt6ICCxgpL4x ydisHAu8IVK49IY4e62v2f0NoEF9lis9EalCk49n1SBhrdNZbRu8rNLVSRQAFfHds78b 8fKE/hYEJ58b+VsvMA/GkQniHSEVFRXJeDo1qQ9CPMdNaC2k+k9lsSV0Tz/eTB0UBpiQ GAtYGeCEJlndbjO4J/wHUyXb2dKd4D1vQ4S/c+mXae/dh69Ak7lzQghS40+U6nGCXYoy NuFQ== X-Gm-Message-State: ALQs6tAxbOK0ODuX5vbwW+AezllBRzGCXqWj61jYxjKyYzUa8X8CWstu 1Jykh4/ngLuzkKBeRTh6I6XE9SHBsW4pFkyijdx6YK4+iHY+MHdKFQijvhwiIMHHZWryhr4gswE cMmFAysOseDq3xZPgt83PbdzVUzvl47qPBsqbxEnTxT8mZlcm3p7f68mOVkg96wKv2gvgtr+8cA == X-Google-Smtp-Source: AIpwx4/iRP4epp49yNq7h8Gw51oB8Zzt0qKDfoPCDO5VRBr0WLMDWJvKOGh1CsFV9rZo/AjOFBmYO2Ub1/+H X-Received: by 10.55.102.19 with SMTP id a19mr12941740qkc.75.1522351006774; Thu, 29 Mar 2018 12:16:46 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id c73sm1291087qke.3.2018.03.29.12.16.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 12:16:46 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from groose.ofa (unknown [IPv6:2606:4100:3880:1240:cc3b:885c:7cb:4a8e]) by postal.iol.unh.edu (Postfix) with ESMTP id 28EFD6045DC7; Thu, 29 Mar 2018 15:16:46 -0400 (EDT) From: Patrick MacArthur To: dts@dpdk.org Cc: dpdklab@iol.unh.edu Date: Thu, 29 Mar 2018 15:16:05 -0400 Message-Id: <20180329191605.5404-8-pmacarth@iol.unh.edu> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180329191605.5404-1-pmacarth@iol.unh.edu> References: <20180329191605.5404-1-pmacarth@iol.unh.edu> Subject: [dts] [PATCH for-next v3 7/7] tests/TestSuite_nic_single_core_perf: Report the results in JSON format X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 19:16:47 -0000 Add a JSON report file in addition to the texttable report file, for easier consumption by other automated tools. The JSON output produced will look like: { "results": [ { "parameters": { "frame_size": 64, "txd/rxd": 1024 }, "throughput": { "result": "PASS", "delta": -0.452, "unit": "Mpps" } }, /* ... */ ] } Each entry in the results list is essentially a table row. The parameters "frame_size" and "txd/rxd" are the input parameters for each given measurement. Each other element in the result dictionary is an output measurement for the given measurement. Signed-off-by: Patrick MacArthur --- tests/TestSuite_nic_single_core_perf.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py index 860fc29f607f..d1b88c3d0157 100644 --- a/tests/TestSuite_nic_single_core_perf.py +++ b/tests/TestSuite_nic_single_core_perf.py @@ -33,6 +33,7 @@ DPDK Test suite. """ import utils +import json import os import re import time @@ -251,6 +252,28 @@ class TestNicSingleCorePerf(TestCase): file_to_save.write(str(table)) file_to_save.close() + json_obj = dict() + json_obj['nic_type'] = self.nic + json_obj['results'] = list() + for frame_size in self.frame_sizes: + for descriptor in self.descriptors: + row_in = self.test_result[frame_size][descriptor] + row_dict = dict() + row_dict['parameters'] = dict() + row_dict['parameters']['frame_size'] = dict( + value=row_in['Frame Size'], unit='bytes') + row_dict['parameters']['txd/rxd'] = dict( + value=row_in['TXD/RXD'], unit='descriptors') + delta = (float(row_in['Throughput'].split()[0]) - + float(row_in['Expected Throughput'].split()[0])) + row_dict['throughput'] = dict( + delta=delta, unit=row_in['Throughput'].split()[1]) + json_obj['results'].append(row_dict) + with open(os.path.join(rst.path2Result, + '{0:s}_single_core_perf.json'.format( + self.nic)), 'w') as fp: + json.dump(json_obj, fp) + def tear_down(self): """ Run after each test case. -- 2.14.1