Vitals CSV file

You can export the vitals metrics that Perfecto collected during a test run to a comma-separated values (CSV) file. This article explains how to export the vitals CSV file using the Perfecto Smart Reporting API.

For information on how to download the file directly from the Perfecto UI, see:

The CSV file includes the following columns:

  • Timestamp: For example 1.67464E+12

  • Formatted Timestamp: In the format yyyy-mm-dd:hh-mm-ss

  • Relative Time: The time that has elapsed since the beginning of the test, in the format hh:mm:ss

  • App Name: The name of the application running in the foreground (if applicable)

  • CPU: The total CPU usage, as derived from the OS, in percentage

  • MEMORY: The overall memory consumption

  • NETWORK_IN: The amount of data received from either the wireless or the mobile network, in megabits per second (Mbps)

  • NETWORK_OUT: The amount of data sent to either the wireless or the mobile network, in megabits per second (Mbps)

  • POWER: The grade at which the application under test uses energy

If the file includes any lines without metrics, this means that no application was open on the device screen. Perfecto only collects vitals from the application running in the foreground.

Download vitals data via API

Perform the following steps to download vitals data via the Perfecto Smart Reporting API. A full code sample is available on GitHub: MetricsCsvDownloadCodeSample.java

To download the vitals CSV file via the API:

  1. Submit a request to generate the CSV file using the method, endpoint URL, header parameters, and body syntax specified in the following table.

    URL

    Copy
    https://<your-cloud>.app.perfectomobile.com/export/api/v3/metrics/csv

    Method

    POST

    Header

    Perfecto-Authorization

    The Perfecto security token. For more information, see Generate security tokens.

    Body

    Copy
    {
        "filter": {
            "fields": {
                "testExecutionId": "<your-test-execution-id"
            }
        }
    }
    Copy
    Sample response
    {
        "taskId": "8ad07739-899a-45b5-8104-45a0c07d1003",
        "status": "IN_PROGRESS"
    }
  2. Get the task details using the method, endpoint URL, and header parameters shown in the following table.

    URL

    Copy
    https://<your-cloud>.app.perfectomobile.com/export/api/v3/metrics/csv/<your-task-id>

    Method

    GET

    Header

    Perfecto-Authorization

    The Perfecto security token. For more information, see Generate security tokens.

    Copy
    Sample response
    {
        "url":"https://covid19.app.dev-stg.perfectomobile.com/download-01/report-generated/csv-01/covid19/report-library-59e84ae2c76e4a9e96eb9255e3dcbbb0-2023_01_26-14_25_15.csv?fileName=report-library-59e84ae2c76e4a9e96eb9255e3dcbbb0-2023_01_26-14_25_15.csv&signature=068ca1d620a823f73f79b667d92d9ead209a7db95dd3652bfa06304f80f4d440",
        "taskId":"8ad07739-899a-45b5-8104-45a0c07d1003",
        "status":"COMPLETE"}
  3. To retrieve the CSV file, perform a GET on the URL received in step 2 using the header parameter specified in the following table.

    Header

    Perfecto-Authorization

    The Perfecto security token. For more information, see Generate security tokens.

    Copy
    Sample vitals CSV file
    Timestamp,Formatted Timestamp,Relative Time,App Name,CPU,MEMORY,NETWORK_IN,NETWORK_OUT,POWER
    1683993863760,2023-05-13:19-04-23,00:00:00,MobileSafari,5.71591,75856.0,23.299805,1.660156,63.0
    1683993864806,2023-05-13:19-04-24,00:00:01,MobileSafari,0.759056,76016.0,0.0,0.0,7.0
    1683993865822,2023-05-13:19-04-25,00:00:02,MobileSafari,0.086855,76016.0,0.0,0.0,5.0
    1683993866860,2023-05-13:19-04-26,00:00:03,MobileSafari,8.44721,80928.0,0.0,0.0,0.0
    1683993867899,2023-05-13:19-04-27,00:00:04,MobileSafari,3.13287,76368.0,0.0,0.0,6.0
    1683993868914,2023-05-13:19-04-28,00:00:05,MobileSafari,3.13287,76368.0,0.0,0.0,8.0
    1683993869932,2023-05-13:19-04-29,00:00:06,MobileSafari,0.022683,76368.0,0.0,0.0,0.0
    1683993870935,2023-05-13:19-04-30,00:00:07,MobileSafari,0.021773,76368.0,0.0,0.0,5.0
    1683993871988,2023-05-13:19-04-31,00:00:08,PMConfigManager,,,,,
    1683993873023,2023-05-13:19-04-33,00:00:09,PMConfigManager,,,,,
    1683993874065,2023-05-13:19-04-34,00:00:10,PMConfigManager,0.0,7072.0,0.0,0.0,0.0
    1683993875089,2023-05-13:19-04-35,00:00:11,PMConfigManager,16.4195,48400.0,0.0,0.0,1.0
    1683993876097,2023-05-13:19-04-36,00:00:12,PMConfigManager,8.09736,50448.0,0.0,0.0,5.0
    1683993877109,2023-05-13:19-04-37,00:00:13,PMConfigManager,0.155287,50448.0,0.0,0.0,0.0
    1683993878112,2023-05-13:19-04-38,00:00:14,PMConfigManager,0.9007,50784.0,0.0,0.0,0.0
    1683993879167,2023-05-13:19-04-39,00:00:15,PMConfigManager,3.42945,51856.0,0.111328,0.007813,9.0
    1683993880232,2023-05-13:19-04-40,00:00:16,PMConfigManager,0.652146,51648.0,0.0,0.0,10.0
    1683993881291,2023-05-13:19-04-41,00:00:18,PMConfigManager,0.619767,51648.0,0.0,0.0,9.0
    1683993882311,2023-05-13:19-04-42,00:00:19,PMConfigManager,0.530954,51648.0,0.0,0.0,9.0
    1683993883358,2023-05-13:19-04-43,00:00:20,PMConfigManager,0.703458,51648.0,0.0,0.0,9.0
    1683993884361,2023-05-13:19-04-44,00:00:21,PMConfigManager,0.703458,51648.0,0.0,0.0,9.0
    1683993885364,2023-05-13:19-04-45,00:00:22,PMConfigManager,0.550028,51568.0,0.0,0.0,9.0
    1683993886416,2023-05-13:19-04-46,00:00:23,PMConfigManager,0.714248,51568.0,0.0,0.0,9.0
    1683993887489,2023-05-13:19-04-47,00:00:24,PMConfigManager,0.752666,50176.0,0.0,0.0,9.0
    1683993888529,2023-05-13:19-04-48,00:00:25,PMConfigManager,0.818095,46336.0,0.0,0.0,9.0
    1683993889533,2023-05-13:19-04-49,00:00:26,PMConfigManager,0.851716,46288.0,0.0,0.0,9.0
    1683993890545,2023-05-13:19-04-50,00:00:27,PMConfigManager,0.853438,46288.0,0.0,0.0,9.0
    1683993891548,2023-05-13:19-04-51,00:00:28,PMConfigManager,0.897971,42880.0,0.0,0.0,9.0
    1683993892551,2023-05-13:19-04-52,00:00:29,PMConfigManager,0.830134,42880.0,0.0,0.0,9.0
    1683993893621,2023-05-13:19-04-53,00:00:30,PMConfigManager,0.881244,42880.0,0.0,0.0,9.0