metrics package

Submodules

metrics.apps module

Defines the application configuration for the scale metrics application

class metrics.apps.MetricsConfig(app_name, app_module)

Bases: django.apps.config.AppConfig

Configuration for the metrics app

label = u'metrics'
name = u'metrics'
ready()

Registers the metrics processors with the clock system.

verbose_name = u'Metrics collection'

metrics.daily_metrics module

Defines the clock event processor for daily system metrics.

class metrics.daily_metrics.DailyMetricsProcessor

Bases: job.clock.ClockEventProcessor

This class schedules daily metrics jobs on the cluster.

process_event(event, last_event=None)

See job.clock.ClockEventProcessor.process_event().

Compares the new event with the last event any missing metrics jobs.

metrics.models module

Defines the database models for various system metrics.

class metrics.models.MetricsError(*args, **kwargs)

Bases: django.db.models.base.Model

Tracks all the error metrics grouped by error type.

Parameters:
  • error (django.db.models.ForeignKey) – The error type associated with these metrics.
  • occurred (django.db.models.DateField) – The date when the errors included in this model were created.
  • total_count (metrics.models.PlotBigIntegerField) – The total number of errors of this type that occurred for the day.
  • created (django.db.models.DateTimeField) – When the model was first created.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

GROUPS = [<metrics.registry.MetricsTypeGroup object>]
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

error_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*moreargs, **morekwargs)
get_next_by_occurred(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
get_previous_by_occurred(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <metrics.models.MetricsErrorManager object>
occurred

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

total_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class metrics.models.MetricsErrorManager

Bases: django.db.models.manager.Manager

Provides additional methods for computing daily error metrics.

calculate(date)

See metrics.registry.MetricsTypeProvider.calculate().

get_metrics_type(include_choices=False)

See metrics.registry.MetricsTypeProvider.get_metrics_type().

get_plot_data(started=None, ended=None, choice_ids=None, columns=None)

See metrics.registry.MetricsTypeProvider.get_plot_data().

class metrics.models.MetricsIngest(*args, **kwargs)

Bases: django.db.models.base.Model

Tracks all the ingest metrics grouped by strike process.

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

GROUPS = [<metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>]
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

deferred_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

duplicate_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

errored_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_size_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_size_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_size_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_size_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*moreargs, **morekwargs)
get_next_by_occurred(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
get_previous_by_occurred(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ingest_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ingest_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ingest_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ingest_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ingested_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <metrics.models.MetricsIngestManager object>
occurred

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

strike

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

strike_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

total_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

transfer_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

transfer_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

transfer_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

transfer_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class metrics.models.MetricsIngestManager

Bases: django.db.models.manager.Manager

Provides additional methods for computing daily ingest metrics.

calculate(date)

See metrics.registry.MetricsTypeProvider.calculate().

get_metrics_type(include_choices=False)

See metrics.registry.MetricsTypeProvider.get_metrics_type().

get_plot_data(started=None, ended=None, choice_ids=None, columns=None)

See metrics.registry.MetricsTypeProvider.get_plot_data().

class metrics.models.MetricsJobType(*args, **kwargs)

Bases: django.db.models.base.Model

Tracks all the job execution metrics grouped by job type.

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

GROUPS = [<metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>, <metrics.registry.MetricsTypeGroup object>]
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

canceled_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

completed_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error_algorithm_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error_data_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error_system_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

failed_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*moreargs, **morekwargs)
get_next_by_occurred(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
get_previous_by_occurred(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

job_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

job_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

job_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

job_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

job_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

job_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <metrics.models.MetricsJobTypeManager object>
occurred

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

post_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

post_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

post_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

post_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pre_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pre_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pre_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pre_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

queue_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

queue_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

queue_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

queue_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

run_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

run_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

run_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

run_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stage_time_avg

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stage_time_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stage_time_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stage_time_sum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

total_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class metrics.models.MetricsJobTypeManager

Bases: django.db.models.manager.Manager

Provides additional methods for computing daily job type metrics.

calculate(date)

See metrics.registry.MetricsTypeProvider.calculate().

get_metrics_type(include_choices=False)

See metrics.registry.MetricsTypeProvider.get_metrics_type().

get_plot_data(started=None, ended=None, choice_ids=None, columns=None)

See metrics.registry.MetricsTypeProvider.get_plot_data().

class metrics.models.PlotBigIntegerField(verbose_name=None, name=None, aggregate=None, group=None, units=None, **kwargs)

Bases: django.db.models.fields.BigIntegerField

Custom field used to indicate a model attribute can be used as a plot value.

Parameters:
  • verbose_name (string) – The display name of the field.
  • name (string) – The internal database name of the field.
  • aggregate (string) – The math operation used to compute the value. Examples: avg, max, min, sum
  • group (string) – The base field name used to group together related values. For example, a field may have several aggregate variations that all reference the same base attribute.
  • units (string) – The mathematical units applied to the value. Examples: seconds, minutes, hours
class metrics.models.PlotIntegerField(verbose_name=None, name=None, aggregate=None, group=None, units=None, **kwargs)

Bases: django.db.models.fields.IntegerField

Custom field used to indicate a model attribute can be used as a plot value.

Parameters:
  • verbose_name (string) – The display name of the field.
  • name (string) – The internal database name of the field.
  • aggregate (string) – The math operation used to compute the value. Examples: avg, max, min, sum
  • group (string) – The base field name used to group together related values. For example, a field may have several aggregate variations that all reference the same base attribute.
  • units (string) – The mathematical units applied to the value. Examples: seconds, minutes, hours

metrics.registry module

Defines general classes used to manage metrics

class metrics.registry.MetricsPlotData(column, min_x=None, max_x=None, min_y=None, max_y=None, values=None)

Bases: object

Represents a series of plot values for a single metrics type column.

Parameters:
  • column (metrics.registry.MetricsTypeColumn) – The metrics type column definition.
  • min_x (datetime.date) – The minimum x-axis value, which is always a date.
  • max_x (datetime.date) – The maximum x-axis value, which is always a date.
  • min_y (int) – The minimum y-axis value, which is always a number.
  • max_y (int) – The maximum y-axis value, which is always a number.
  • values (list[metrics.registry.MetricsPlotValue]) – A list of the actual plot values in the series.
classmethod create(query_set, date_field, choice_field, choice_ids, columns)

Creates new metrics plot data records from a query set of database models.

Parameters:
  • query_set (django.models.QuerySet) – A set of database models that are being counted towards metrics.
  • date_field (string) – The name of the field within each model that contains the recorded date.
  • choice_field (string) – The name of the field within each model that contains the choice model relation.
  • choice_ids ([string]) – A list of related model identifiers to query.
  • columns (list[metrics.registry.MetricsTypeColumn]) – A list of metrics type column definitions that should be included.
Returns:

The plot data models that were created.

Return type:

list[metrics.registry.MetricsPlotData]

class metrics.registry.MetricsPlotValue(choice_id, datetime, value=0, count=0, total=0)

Bases: object

Represents a single value within a series of values for a metrics type column.

Parameters:
  • choice_id (string) – The unique identifier of the choice model associated with the value.
  • date (datetime.date) – The date when the plot value occurred.
  • value (int) – The actual plot value that was recorded.
  • count (int) – The number of records contributing to this plot value.
  • total (int) – The total values of all records contributing to this plot value.
class metrics.registry.MetricsType(name, title=None, description=None, filters=None, groups=None, columns=None, choices=None)

Bases: object

Represents a type of metrics that can be queried.

Parameters:
  • name (string) – The system name of the metrics type.
  • title (string) – The human-friendly display name of the metrics type.
  • description (string) – A longer description of the metrics type.
  • filters (list[metrics.registry.MetricsTypeFilter]) – A list of filter parameter definitions supported by the metrics type.
  • columns (list[metrics.registry.MetricsTypeColumn]) – A list of available columns supported by the metrics type.
  • choices (object) – A list of available models that can be used as filters for the metrics type. Each metrics type can use its own choice models, but any fields listed as filters must be included here at a minimum.
get_column(column_name)

Gets the column model associated with the given name.

Parameters:column_name (string) – The name of the column to lookup.
Returns:The metrics type column.
Return type:metrics.registry.MetricsTypeColumn
get_column_names()

Gets a list of all column names for this metrics type.

Column names can be used to select a specific series of plot values.

Returns:The metrics type column names.
Return type:[string]
get_column_set(column_names=None, group_names=None)

Gets the combined set of column models derived from the given names and groups.

Column names use a simple lookup to get the corresponding column model and the group name is used to find all columns with a matching a value. Duplicates are then removed to produce the final result.

Parameters:
  • column_names ([string]) – The names of the columns to lookup.
  • group_names ([string]) – The names of the groups to lookup.
Returns:

The metrics type columns.

Return type:

set[metrics.registry.MetricsTypeColumn]

get_group_columns(group_names)

Gets the set of column models associated with the given groups.

The group name is used to find all columns with a matching a value. Duplicates are then removed to produce the final result.

Parameters:group_names ([string]) – The names of the groups to lookup.
Returns:The metrics type columns.
Return type:set[metrics.registry.MetricsTypeColumn]
set_columns(model_class, field_types)

Sets all the metric type columns by inspecting the given database model.

Parameters:
  • model_class (django.db.models.Model) – The class type of the metrics model to inspect.
  • field_types (list[django.db.models.Field]) – The model field types to include as metrics columns.
Returns:

The metrics type columns.

Return type:

set[metrics.registry.MetricsTypeColumn]

class metrics.registry.MetricsTypeColumn(name, title=None, description=None, units=None, group=None, aggregate=None)

Bases: object

Represents an attribute of a metrics type that can be selected as a series of plot values.

Parameters:
  • name (string) – The system name of the column.
  • title (string) – The human-friendly display name of the column.
  • description (string) – A longer description of the column.
  • units (string) – The mathematical units applied to the value. Examples: seconds, minutes, hours
  • group (string) – The base field name used to group together related values. For example, a field may have several aggregate variations that all reference the same base attribute.
  • aggregate (string) – The math operation used to compute the value. Examples: avg, max, min, sum
exception metrics.registry.MetricsTypeError

Bases: exceptions.Exception

Error class used when there is a problem generating metrics.

class metrics.registry.MetricsTypeFilter(param, param_type=u'string')

Bases: object

Represents a parameter that can be used to filter metrics type values.

Parameters:
  • param (string) – The name of the filter parameter.
  • param_type – The data type of the filter parameter. Examples: bool, date, datetime, float, int, string, time
class metrics.registry.MetricsTypeGroup(name, title=None, description=None)

Bases: object

Represents a group of attributes for a metrics type that can be selected as a series of plot values.

Parameters:
  • name (string) – The system name of the group.
  • title (string) – The human-friendly display name of the group.
  • description (string) – A longer description of the group.
class metrics.registry.MetricsTypeProvider

Bases: object

Base class used to handle requests for specific types of metrics.

calculate(date)

Calculates and saves new metrics models grouped by the given date.

Parameters:date (datetime.date) – The target date metrics should be based on.
get_metrics_type(include_choices=False)

Gets the metrics type model handled by this provider.

Parameters:include_choices (bool) – Whether or not to include all the possible model choices that can be used to filter metrics generated by this provider. Since the list of choices can be large and require additional database queries they are not included by default.
Returns:The metrics type for this provider.
Return type:metrics.registry.MetricsType
get_plot_data(started=None, ended=None, choice_ids=None, columns=None)

Gets a list of plot values based on the given query parameters.

Parameters:
  • started (datetime.date) – The start of the time range to query.
  • ended (datetime.date) – The end of the time range to query.
  • choice_ids ([string]) – A list of related model identifiers to query.
  • columns ({metrics.registry.MetricsTypeColumn}) – A list of metric columns to include from the metric type.
Returns:

A series of plot values that match the query.

Return type:

list[metrics.registry.MetricsPlotData]

metrics.registry.get_metrics_type(name, include_choices=False)

Gets the metrics type registered with the given name.

Parameters:
  • name (string) – The name of the metrics type to retrieve.
  • include_choices (bool) – Whether or not to include all the possible model choices that can be used to filter metrics generated by this provider. Since the list of choices can be large and require additional database queries they are not included by default.
Returns:

The metrics type list.

Return type:

list[metrics.registry.MetricsType]

metrics.registry.get_metrics_types()

Gets a list of all registered metrics types.

Returns:The metrics type list.
Return type:list[metrics.registry.MetricsType]
metrics.registry.get_provider(name)

Gets the metrics provider registered with the given name.

Parameters:name (string) – The name of the metrics provider to retrieve.
Returns:The metrics provider associated with the name.
Return type:metrics.registry.MetricsTypeProvider

:raises metrics.registry.MetricsTypeError: If the registration is missing.

metrics.registry.get_providers()

Gets a list of all registered metrics providers.

Returns:The current metrics provider list.
Return type:list[metrics.registry.MetricsTypeProvider]
metrics.registry.get_serializer(name)

Gets the model serializer class for the given metrics type name.

Parameters:name (string) – The name of the metrics type serializer to retrieve.
Returns:The class used to serialize the metrics type.
Return type:metrics.serializers.MetricsTypeDetailsSerializer
metrics.registry.register_provider(provider, serializer_class=None)

Registers the given metrics type definition to be called by the metrics management system.

Parameters:

metrics.serializers module

Defines the serializers for metrics

class metrics.serializers.MetricsErrorDetailsSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: metrics.serializers.MetricsTypeDetailsSerializer

Converts ingest metrics details model fields to REST output

class ErrorBaseSerializerV6(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: util.rest.ModelIdSerializer

Converts error model fields to REST output

class metrics.serializers.MetricsIngestDetailsSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: metrics.serializers.MetricsTypeDetailsSerializer

Converts ingest metrics details model fields to REST output

class StrikeBaseSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: util.rest.ModelIdSerializer

Converts strike model fields to REST output

class metrics.serializers.MetricsJobTypeDetailsSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: metrics.serializers.MetricsTypeDetailsSerializer

Converts job type metrics details model fields to REST output

class JobTypeBaseSerializerV6(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: util.rest.ModelIdSerializer

Converts job type model fields to REST output

class metrics.serializers.MetricsPlotMultiSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: metrics.serializers.MetricsPlotSerializer

Converts metrics plot values to REST output

class metrics.serializers.MetricsPlotSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics plot values to REST output

class metrics.serializers.MetricsPlotValueSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics plot values to REST output

to_representation(obj)
class metrics.serializers.MetricsTypeBaseSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics type model fields to REST output

class metrics.serializers.MetricsTypeColumnSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics column model fields to REST output

class metrics.serializers.MetricsTypeDetailsSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: metrics.serializers.MetricsTypeSerializer

Converts metrics details model fields to REST output

class metrics.serializers.MetricsTypeFilterSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics filter model fields to REST output

class metrics.serializers.MetricsTypeGroupSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics group model fields to REST output

class metrics.serializers.MetricsTypeSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Bases: rest_framework.serializers.Serializer

Converts metrics type model fields to REST output

metrics.urls module

Defines the URLs for the RESTful metrics services

metrics.views module

Defines the views for the RESTful metrics services

class metrics.views.MetricDetailsView(**kwargs)

Bases: rest_framework.generics.RetrieveAPIView

This view is the endpoint for retrieving details of metrics.

retrieve(request, name)

Retrieves the details for metrics and return them in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
retrieve_impl(request, name)

Retrieves the details for metrics and return them in JSON form

Parameters:
  • request (rest_framework.request.Request) – the HTTP GET request
  • name (string) – the name of the metrics detail to retrieve.
Return type:

rest_framework.response.Response

Returns:

the HTTP response to send back to the user

retrieve_v6(request, name)

Gets v6 metrics type details in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
class metrics.views.MetricPlotView(**kwargs)

Bases: rest_framework.generics.ListAPIView

This view is the endpoint for retrieving plot values of metrics.

list(request, name)

Retrieves the plot values for metrics and return them in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
list_impl(request, name)

Retrieves the plot values for metrics and return them in JSON form

Parameters:
  • request (rest_framework.request.Request) – the HTTP GET request
  • name (string) – the name of the metrics detail to retrieve.
Return type:

rest_framework.response.Response

Returns:

the HTTP response to send back to the user

list_v6(request, name)

Gets v6 plot values for metrics in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
queryset = []
class metrics.views.MetricsGanttChartRecipeTypesView(**kwargs)

Bases: rest_framework.generics.ListAPIView

This view is the endpoint for retrieving gantt chart values for recipe types

list(request, name)

Retrieves the gantt chart values and return them in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
list_impl(request, name)

Retrieves the plot values for metrics and return them in JSON form

Parameters:
  • request (rest_framework.request.Request) – the HTTP GET request
  • name (string) – the name of the metrics detail to retrieve.
Return type:

rest_framework.response.Response

Returns:

the HTTP response to send back to the user

list_v6(request, name)

Gets v6 plot values for metrics in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
queryset = []
class metrics.views.MetricsView(**kwargs)

Bases: rest_framework.generics.ListAPIView

This view is the endpoint for retrieving available types of metrics.

list(request)

Retrieves the metrics types and returns it in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
list_impl(request)

Retrieves the metrics types and returns it in JSON form

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
list_v6(request)

Gets v6 metrics types

Parameters:request (rest_framework.request.Request) – the HTTP GET request
Return type:rest_framework.response.Response
Returns:the HTTP response to send back to the user
queryset = [<metrics.registry.MetricsType object>, <metrics.registry.MetricsType object>, <metrics.registry.MetricsType object>]
serializer_class

alias of MetricsTypeSerializer

Module contents