Skip to main content

1E 23.7 (SaaS)

Custom Response Definitions

Definition of the format of JSON object used for Custom Response Visualizations.

Response Visualization Definition

A response visualization definition must be provided in each instruction definition that requires a custom response visualization. This is because it is tightly coupled to instruction definition schema. The configuration is JSON based.

Template Configuration Properties

{
  "Name": "default",
  "TemplateConfigurations": [
    {
      Configuration for chart 1
    },
    {
      Configuration for chart 2
    }
  ],
  "PostProcessors": [
    {
      PostProcessor 1 definition
    },
    {
      PostProcessor 2 definition
    }
  ]
}

From the JSON above we can see it has three properties.

Property

Meaning

Name

This property is the name of a template. Tachyon comes with one default template named "default".

TemplateConfigurations

This property contains an array of one or more template configurations. Each configuration defines how the specified template will be used, which aggregated response columns are used, and which processors are used to render the specified visualization.

PostProcessors

This property contains an array of processor definitions. Each definition specifies the configuration of a single processor. The same processor can be used by multiple visualizations.

Example

Example

{
  "Name": "default",
  "TemplateConfigurations": [
    {
      "Id": "column1",
      "Title": "15 most common new process starts",
      "Type": "Column",
      "X": "ExecutableName",
      "Y": "Count",
      "PostProcessor": "processingFunction",
      "Size": 1,
      "Row": 1
    }
  ],
  "PostProcessors": [
    {
      "Name": "processingFunction",
      "Function": "ProcessSingleSeries('ExecutableName', 'Count', '15', 'Count', 'false')"
    }
  ]
}
Name Property

This property is the name of a template. Tachyon comes with one default template named "default". At the moment, only "default" template is available and that template handles various types of charts and graphs. In future it would be possible to create custom templates.

TemplateConfigurations Property

This property contains an array of one or more template configurations. Each configuration defines how the specified template will be used, which aggregated response columns are used, and which processors are used to render the specified visualization. At this time "default" is the only supported type of template, which provides an array of chart and graph types. Therefore, each definition describes what chart or graph can be created, which response columns are plotted, where the chart will be positioned and also how its data is to be processed using a PostProcessor.

Property

Meaning

Id

Unique chart id. It must be unique in the array of charts.

Tip

The id is a name, and it helps if it relates to the position on the screen (row, size) when multiple configurations (eg chart) are used within a single definition. For example, TopLeft.

Title

Title to be displayed for the chart.

Type

Supported charts are:

  • Pie

  • SmartBar

  • Line

  • Bar

  • Column

  • Area

  • StackedArea

X

Column name used for label, which must be present in aggregation schema. The label can be any datatype, except for time series processors which must be a valid date time.

Y

Column name used for quantity, which must be present in aggregation schema. The quantity must be a numeric dataype.

Z

Column name used for grouping, which if used, must be present in aggregation schema. The grouping can be any datatype.

Used only for Line, Bar, Column, Area and StackedArea types.

PostProcessor

Name of the PostProcessor used to prepare responses to be consumed by the chart. The PostProcessor must be defined in the PostProcessors arrray.

Row

Row number in which the chart will be displayed. This is an integer value. One row can contain more than one chart.

Size

How much space the vizualization occupies in proportion to other vizualizations in the same row. This is an integer value. Ignored if there is only one vizualization in a row.

Template configuration example

{
  "Id": "TopLeft",
  "Title": "15 most common new process starts",
  "Type": "Column",
  "X": "ExecutableName",
  "Y": "Count",
  "PostProcessor": "processingFunction",
  "Size": 1,
  "Row": 1
}
PostProcessors Property

This property contains an array of processor definitions. Each definition specifies the configuration of a single processor. The same processor can be used by multiple visualizations. Each response processor prepares data to be consumed by a visualization and must produce data in a format expected by that visualization. V isualizations expect all the data preparation and formatting to be done by the processors and they will not do any themselves. They will simply take the processor output and attempt to use it directly as their data source. In case of charts this means attempting to plot chart specified in the visualization using the data provided by the processor.

Property

Meaning

Name

Unique name of the processor. This name is referenced in the PostProcessor field of TemplateConfigurations property.

Function

The call to a built-in processor function, used to process response data. Consists of processor name followed by a list of parameters inside parentheses. Parameters are specific to each built-in processor .

Cannot be used in conjuction with Script.

Script

Custom C# code, used to process response data.

Cannot be used in conjuction with Function.

Please note that Function and Script are mutually exclusive.

Built-in PostProcessor example

{
  "Name": "processingFunction",
  "Function": "ProcessSingleSeries('ExecutableName', 'Count', '15', 'Count', 'false')"
}

Script based PostProcessor example

{  
  "Name": "processingFunction",
  "Script": "var xaxis = \"ProcessName\"; 
          var yaxis = \"Average\"; 
          var yaxis = \"Average\";
          var items = responses.Select(r => { var obj = new JObject(); obj.Add(xaxis, Convert.ToString(r.Values[\"ProcessName\"])); obj.Add(yaxis, (Convert.ToInt64(r.Values[\"Sum\"]) / Convert.ToInt64(r.Values[\"Count\"]))); return obj; }).ToList();
          var result = new JObject();
          result.Add(\"Name\", \"Average CPU Usage (%)\");
          result.Add(\"Total\", 0);
          result.Add(\"Items\", JToken.FromObject(items));
          var cake = new List<JObject>();
          cake.Add(result);
          return JsonConvert.SerializeObject(cake);"
}

In the above example, the instruction that has aggregation schema with 3 columns: "Sum", "Count" and "ProcessName".