/*
 * Copyright (c) 2015 ezivkoc
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package zutil.osal.app.windows;

import zutil.osal.OSAbstractionLayer;
import zutil.parser.CSVParser;
import zutil.parser.DataNode;

import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by ezivkoc on 2015-07-30.
 */
public class TypePerf {
    // Only available Vista and later...
    //https://www.webperformance.com/support/suite/manual/Content/Locating_Server_Metric_Counters.htm

    /*
    "(PDH-CSV 4.0)","\\SE00035694\processor(0)\% Processor Time","\\SE00035694\processor(0)\% User Time","\\SE00035694\processor(0)\% Privileged Time","\\SE00035694\processor(0)\Interrupts/sec","\\SE00035694\processor(0)\% DPC Time","\\SE00035694\processor(0)\% Interrupt Time","\\SE00035694\processor(0)\DPCs Queued/sec","\\SE00035694\processor(0)\DPC Rate","\\SE00035694\processor(0)\% Idle Time","\\SE00035694\processor(0)\% C1 Time","\\SE00035694\processor(0)\% C2 Time","\\SE00035694\processor(0)\% C3 Time","\\SE00035694\processor(0)\C1 Transitions/sec","\\SE00035694\processor(0)\C2 Transitions/sec","\\SE00035694\processor(0)\C3 Transitions/sec","\\SE00035694\processor(1)\% Processor Time","\\SE00035694\processor(1)\% User Time","\\SE00035694\processor(1)\% Privileged Time","\\SE00035694\processor(1)\Interrupts/sec","\\SE00035694\processor(1)\% DPC Time","\\SE00035694\processor(1)\% Interrupt Time","\\SE00035694\processor(1)\DPCs Queued/sec","\\SE00035694\processor(1)\DPC Rate","\\SE00035694\processor(1)\% Idle Time","\\SE00035694\processor(1)\% C1 Time","\\SE00035694\processor(1)\% C2 Time","\\SE00035694\processor(1)\% C3 Time","\\SE00035694\processor(1)\C1 Transitions/sec","\\SE00035694\processor(1)\C2 Transitions/sec","\\SE00035694\processor(1)\C3 Transitions/sec","\\SE00035694\processor(2)\% Processor Time","\\SE00035694\processor(2)\% User Time","\\SE00035694\processor(2)\% Privileged Time","\\SE00035694\processor(2)\Interrupts/sec","\\SE00035694\processor(2)\% DPC Time","\\SE00035694\processor(2)\% Interrupt Time","\\SE00035694\processor(2)\DPCs Queued/sec","\\SE00035694\processor(2)\DPC Rate","\\SE00035694\processor(2)\% Idle Time","\\SE00035694\processor(2)\% C1 Time","\\SE00035694\processor(2)\% C2 Time","\\SE00035694\processor(2)\% C3 Time","\\SE00035694\processor(2)\C1 Transitions/sec","\\SE00035694\processor(2)\C2 Transitions/sec","\\SE00035694\processor(2)\C3 Transitions/sec","\\SE00035694\processor(3)\% Processor Time","\\SE00035694\processor(3)\% User Time","\\SE00035694\processor(3)\% Privileged Time","\\SE00035694\processor(3)\Interrupts/sec","\\SE00035694\processor(3)\% DPC Time","\\SE00035694\processor(3)\% Interrupt Time","\\SE00035694\processor(3)\DPCs Queued/sec","\\SE00035694\processor(3)\DPC Rate","\\SE00035694\processor(3)\% Idle Time","\\SE00035694\processor(3)\% C1 Time","\\SE00035694\processor(3)\% C2 Time","\\SE00035694\processor(3)\% C3 Time","\\SE00035694\processor(3)\C1 Transitions/sec","\\SE00035694\processor(3)\C2 Transitions/sec","\\SE00035694\processor(3)\C3 Transitions/sec","\\SE00035694\processor(_Total)\% Processor Time","\\SE00035694\processor(_Total)\% User Time","\\SE00035694\processor(_Total)\% Privileged Time","\\SE00035694\processor(_Total)\Interrupts/sec","\\SE00035694\processor(_Total)\% DPC Time","\\SE00035694\processor(_Total)\% Interrupt Time","\\SE00035694\processor(_Total)\DPCs Queued/sec","\\SE00035694\processor(_Total)\DPC Rate","\\SE00035694\processor(_Total)\% Idle Time","\\SE00035694\processor(_Total)\% C1 Time","\\SE00035694\processor(_Total)\% C2 Time","\\SE00035694\processor(_Total)\% C3 Time","\\SE00035694\processor(_Total)\C1 Transitions/sec","\\SE00035694\processor(_Total)\C2 Transitions/sec","\\SE00035694\processor(_Total)\C3 Transitions/sec"
    "07/30/2015 11:53:49.003","4.331731","4.629110","0.000000","1251.466768","0.000000","0.000000","58.368806","0.000000","95.668269","4.370950","3.882572","71.775440","219.624998","61.336711","1197.055170","4.331731","0.000000","1.543037","342.298420","1.543037","0.000000","147.405967","0.000000","98.754342","0.000000","0.000000","95.856588","0.000000","0.000000","341.309119","5.874768","6.172146","0.000000","1282.135124","0.000000","0.000000","23.743243","0.000000","94.125232","0.000000","0.000000","86.960208","0.000000","0.000000","1496.813613","4.331731","0.000000","0.000000","253.261259","0.000000","0.000000","19.786036","1.000000","100.297379","0.000000","0.000000","94.635420","0.000000","0.000000","265.132881","4.717488","2.700317","0.385757","3129.161571","0.385757","0.000000","249.304052","1.000000","97.211306","1.092740","0.970643","87.306914","219.624998","61.336711","3300.310781"
     */
    private static final String PERF_CPU_PATH = "\\Processor(*)\\*";

    /*
    "(PDH-CSV 4.0)","\\SE00035694\Memory\Page Faults/sec","\\SE00035694\Memory\Available Bytes","\\SE00035694\Memory\Committed Bytes","\\SE00035694\Memory\Commit Limit","\\SE00035694\Memory\Write Copies/sec","\\SE00035694\Memory\Transition Faults/sec","\\SE00035694\Memory\Cache Faults/sec","\\SE00035694\Memory\Demand Zero Faults/sec","\\SE00035694\Memory\Pages/sec","\\SE00035694\Memory\Pages Input/sec","\\SE00035694\Memory\Page Reads/sec","\\SE00035694\Memory\Pages Output/sec","\\SE00035694\Memory\Pool Paged Bytes","\\SE00035694\Memory\Pool Nonpaged Bytes","\\SE00035694\Memory\Page Writes/sec","\\SE00035694\Memory\Pool Paged Allocs","\\SE00035694\Memory\Pool Nonpaged Allocs","\\SE00035694\Memory\Free System Page Table Entries","\\SE00035694\Memory\Cache Bytes","\\SE00035694\Memory\Cache Bytes Peak","\\SE00035694\Memory\Pool Paged Resident Bytes","\\SE00035694\Memory\System Code Total Bytes","\\SE00035694\Memory\System Code Resident Bytes","\\SE00035694\Memory\System Driver Total Bytes","\\SE00035694\Memory\System Driver Resident Bytes","\\SE00035694\Memory\System Cache Resident Bytes","\\SE00035694\Memory\% Committed Bytes In Use","\\SE00035694\Memory\Available KBytes","\\SE00035694\Memory\Available MBytes","\\SE00035694\Memory\Transition Pages RePurposed/sec","\\SE00035694\Memory\Free & Zero Page List Bytes","\\SE00035694\Memory\Modified Page List Bytes","\\SE00035694\Memory\Standby Cache Reserve Bytes","\\SE00035694\Memory\Standby Cache Normal Priority Bytes","\\SE00035694\Memory\Standby Cache Core Bytes"
    "07/30/2015 11:54:52.288","1158.202545","1403789312.000000","7621783552.000000","18949070848.000000","0.000000","13.942249","1.991750","1142.268546","0.000000","0.000000","0.000000","0.000000","408887296.000000","184975360.000000","0.000000","430072.000000","242142.000000","33556038.000000","600846336.000000","650051584.000000","408686592.000000","4395008.000000","2433024.000000","19406848.000000","10178560.000000","600846336.000000","40.222466","1370888.000000","1338.000000","0.000000","25022464.000000","46465024.000000","24576.000000","1378742272.000000","0.000000"
     */
    private static final String PERF_MEM_PATH = "\\Memory\\*";

    /*
    "(PDH-CSV 4.0)","\\SE00035694\PhysicalDisk(0 C: D: E:)\Current Disk Queue Length","\\SE00035694\PhysicalDisk(0 C: D: E:)\% Disk Time","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk Queue Length","\\SE00035694\PhysicalDisk(0 C: D: E:)\% Disk Read Time","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk Read Queue Length","\\SE00035694\PhysicalDisk(0 C: D: E:)\% Disk Write Time","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk Write Queue Length","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk sec/Transfer","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk sec/Read","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk sec/Write","\\SE00035694\PhysicalDisk(0 C: D: E:)\Disk Transfers/sec","\\SE00035694\PhysicalDisk(0 C: D: E:)\Disk Reads/sec","\\SE00035694\PhysicalDisk(0 C: D: E:)\Disk Writes/sec","\\SE00035694\PhysicalDisk(0 C: D: E:)\Disk Bytes/sec","\\SE00035694\PhysicalDisk(0 C: D: E:)\Disk Read Bytes/sec","\\SE00035694\PhysicalDisk(0 C: D: E:)\Disk Write Bytes/sec","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk Bytes/Transfer","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk Bytes/Read","\\SE00035694\PhysicalDisk(0 C: D: E:)\Avg. Disk Bytes/Write","\\SE00035694\PhysicalDisk(0 C: D: E:)\% Idle Time","\\SE00035694\PhysicalDisk(0 C: D: E:)\Split IO/Sec","\\SE00035694\PhysicalDisk(_Total)\Current Disk Queue Length","\\SE00035694\PhysicalDisk(_Total)\% Disk Time","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk Queue Length","\\SE00035694\PhysicalDisk(_Total)\% Disk Read Time","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk Read Queue Length","\\SE00035694\PhysicalDisk(_Total)\% Disk Write Time","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk Write Queue Length","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk sec/Transfer","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk sec/Read","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk sec/Write","\\SE00035694\PhysicalDisk(_Total)\Disk Transfers/sec","\\SE00035694\PhysicalDisk(_Total)\Disk Reads/sec","\\SE00035694\PhysicalDisk(_Total)\Disk Writes/sec","\\SE00035694\PhysicalDisk(_Total)\Disk Bytes/sec","\\SE00035694\PhysicalDisk(_Total)\Disk Read Bytes/sec","\\SE00035694\PhysicalDisk(_Total)\Disk Write Bytes/sec","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk Bytes/Transfer","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk Bytes/Read","\\SE00035694\PhysicalDisk(_Total)\Avg. Disk Bytes/Write","\\SE00035694\PhysicalDisk(_Total)\% Idle Time","\\SE00035694\PhysicalDisk(_Total)\Split IO/Sec"
    "07/30/2015 11:55:26.544","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100.148515","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100.148515","0.000000"
     */
    private static final String PERF_DISK_PATH = "\\PhysicalDisk(*)\\*";

    /*
    "(PDH-CSV 4.0)","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Bytes Total/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Received/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Sent/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Current Bandwidth","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Bytes Received/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Received Unicast/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Received Discarded","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Received Errors","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Received Unknown","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Bytes Sent/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Sent Unicast/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Outbound Discarded","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Packets Outbound Errors","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Output Queue Length","\\SE00035694\Network Interface(Intel[R] Ethernet Connection I218-LM)\Offloaded Connections","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Bytes Total/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Received/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Sent/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Current Bandwidth","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Bytes Received/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Received Unicast/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Received Discarded","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Received Errors","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Received Unknown","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Bytes Sent/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Sent Unicast/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Outbound Discarded","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Packets Outbound Errors","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Output Queue Length","\\SE00035694\Network Interface(Intel[R] Dual Band Wireless-N 7260)\Offloaded Connections","\\SE00035694\Network Interface(6TO4 Adapter)\Bytes Total/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Received/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Sent/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Current Bandwidth","\\SE00035694\Network Interface(6TO4 Adapter)\Bytes Received/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Received Unicast/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Received Discarded","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Received Errors","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Received Unknown","\\SE00035694\Network Interface(6TO4 Adapter)\Bytes Sent/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Sent Unicast/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Outbound Discarded","\\SE00035694\Network Interface(6TO4 Adapter)\Packets Outbound Errors","\\SE00035694\Network Interface(6TO4 Adapter)\Output Queue Length","\\SE00035694\Network Interface(6TO4 Adapter)\Offloaded Connections","\\SE00035694\Network Interface(Local Area Connection* 12)\Bytes Total/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Received/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Sent/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Current Bandwidth","\\SE00035694\Network Interface(Local Area Connection* 12)\Bytes Received/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Received Unicast/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Received Discarded","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Received Errors","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Received Unknown","\\SE00035694\Network Interface(Local Area Connection* 12)\Bytes Sent/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Sent Unicast/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Outbound Discarded","\\SE00035694\Network Interface(Local Area Connection* 12)\Packets Outbound Errors","\\SE00035694\Network Interface(Local Area Connection* 12)\Output Queue Length","\\SE00035694\Network Interface(Local Area Connection* 12)\Offloaded Connections","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Bytes Total/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Received/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Sent/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Current Bandwidth","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Bytes Received/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Received Unicast/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Received Discarded","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Received Errors","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Received Unknown","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Bytes Sent/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Sent Unicast/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Outbound Discarded","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Packets Outbound Errors","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Output Queue Length","\\SE00035694\Network Interface(isatap.ki.sw.ericsson.se)\Offloaded Connections","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Bytes Total/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Received/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Sent/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Current Bandwidth","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Bytes Received/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Received Unicast/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Received Discarded","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Received Errors","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Received Unknown","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Bytes Sent/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Sent Unicast/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Outbound Discarded","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Packets Outbound Errors","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Output Queue Length","\\SE00035694\Network Interface(isatap.{B9D01222-E737-4A0B-8321-7FE782CD4197})\Offloaded Connections","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Bytes Total/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Received/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Sent/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Current Bandwidth","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Bytes Received/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Received Unicast/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Received Discarded","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Received Errors","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Received Unknown","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Bytes Sent/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Sent Unicast/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Outbound Discarded","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Packets Outbound Errors","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Output Queue Length","\\SE00035694\Network Interface(isatap.{BA17492A-F69D-42F3-890A-3E9B8D2DA7C9})\Offloaded Connections","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Bytes Total/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Received/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Sent/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Current Bandwidth","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Bytes Received/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Received Unicast/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Received Non-Unicast/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Received Discarded","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Received Errors","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Received Unknown","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Bytes Sent/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Sent Unicast/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Sent Non-Unicast/sec","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Outbound Discarded","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Packets Outbound Errors","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Output Queue Length","\\SE00035694\Network Interface(isatap.{A42279F6-5D04-468C-A354-23EC38A4D962})\Offloaded Connections"
    "07/30/2015 11:56:40.899","6479.124376","13.269125","9.477947","3.791179","100000000.000000","6183.412438","5.686768","3.791179","0.000000","0.000000","0.000000","295.711938","3.791179","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","300000000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","30000000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","100000.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000","0.000000"
     */
    private static final String PERF_NET_PATH = "\\Network Interface(*)\\*";



    private static DataNode[] execute(String path) throws IOException {
        DataNode[] ret = new DataNode[2];

        String[] output = OSAbstractionLayer.runCommand("typeperf \""+ path +"\"  -SC 0 -y");
        CSVParser parser = new CSVParser(new StringReader(output[1] + "\n" + output[2]));

        ret[0] = parser.getHeaders();
        ret[1] = parser.read();
        return ret;
    }
}
