Modules

oc_reporter oc_reporter_noop oc_reporter_sequential oc_reporter_zipkin oc_sampler oc_sampler_always oc_sampler_never oc_sampler_probability oc_server oc_span oc_span_ctx_binary oc_span_ctx_header oc_stat oc_stat_aggregation oc_stat_aggregation_count oc_stat_aggregation_distribution oc_stat_aggregation_latest oc_stat_aggregation_sum oc_stat_config oc_stat_exporter oc_stat_exporter_prometheus oc_stat_measure oc_stat_view oc_std_encoder oc_tag_ctx_binary oc_tag_ctx_header oc_tags oc_trace oc_trace_pb oc_transform ocp opencensus opencensus_app opencensus_sup

Module oc_stat_view

View allows users to aggregate the recorded Measurements.

Description

Views need to be passed to the subscribe function to be before data will be collected and sent to exporters.

Data Types

aggregation()


      aggregation() = module()
      

aggregation_options()


      aggregation_options() = any()
      

description()


      description() = binary() | string()
      

measure_name()


      measure_name() = atom() | binary() | string()
      

name()


      name() = atom() | binary() | string()
      

view()


      view() = #view{name = name() | _, measure = oc_stat_measure:measure() | measure_name() | _, unit = oc_stat_measure:unit(), subscribed = boolean(), description = description() | _, ctags = oc_tags:tags() | _, tags = [oc_tags:key()] | _, aggregation = aggregation() | _, aggregation_options = aggregation_options() | _}
      

view_data()


      view_data() = #{name => name(), description => description(), ctags => oc_tags:tags(), tags => [oc_tags:key()], data => oc_stat_aggregation:data()}
      

Function Index

deregister/1 Deregisters the view.
export/1 Returns a snapshot of the View's data.
is_registered/1 Returns true if the view is registered.
is_subscribed/1 Returns true if the view is exporting data by subscription.
new/1 Creates a View from a map.
new/5 Creates a View.
new/6
register/1 Registers the view.
register/5 Registers the view created from arguments.
register/6
subscribe/1 Subscribe the View, When subscribed, a view can aggregate measure data and export it.
subscribe/5 A shortcut: Creates, Registers, and Subscribes a view in one call.
subscribe/6
unsubscribe/1 Unsubscribes the View.

Function Details

deregister/1


      deregister(View::name() | view()) -> ok
      

Deregisters the view. If subscribed, unsubscribes and therefore existing aggregation data cleared.

Returns {error, {unknown_view, Name}} if the view is unknown.

export/1


      export(View::view()) -> view_data()
      

Returns a snapshot of the View's data.

is_registered/1


      is_registered(View::name() | view()) -> boolean()
      

Returns true if the view is registered.

is_subscribed/1


      is_subscribed(View::name() | view()) -> boolean()
      

Returns true if the view is exporting data by subscription.

new/1

new(Map) -> any()

Creates a View from a map.

new/5

new(Name, Measure, Description, Tags, Aggregation) -> any()

Creates a View. This view needs to be registered and subscribed to a measure in order to start aggregating data.

new/6

new(Name, Measure, Unit, Description, Tags, Aggregation) -> any()

register/1


      register(View::view()) -> {ok, view()} | {error, any()}
      

Registers the view. Aggregation initialized with AggregationOptions.

Returns {error, {unknown_measure, Measure}} if Measure is unknown. Returns {error, {view_already_exists, Name}} if a view with Name already registered.

register/5

register(Name, Measure, Description, Tags, Aggregation) -> any()

Registers the view created from arguments.

Returns {error, {unknown_measure, Measure}} if Measure is unknown. Returns {error, {view_already_exists, Name}} if a view with Name already registered.

register/6

register(Name, Measure, Unit, Description, Tags, Aggregation) -> any()

subscribe/1


      subscribe(Map::name() | view() | map()) -> {ok, view()} | {error, any()}
      

Subscribe the View, When subscribed, a view can aggregate measure data and export it.

Returns {error, {unknown_view, Name}} if Name view is unknown.

subscribe/5

subscribe(Name, Measure, Description, Tags, Aggregation) -> any()

A shortcut: Creates, Registers, and Subscribes a view in one call.

Returns {error, {unknown_measure, Measure}} if Measure is unknown.

subscribe/6

subscribe(Name, Measure, Unit, Description, Tags, Aggregation) -> any()

unsubscribe/1


      unsubscribe(View::name() | view()) -> ok
      

Unsubscribes the View. When unsubscribed a view no longer aggregates measure data and exports it. Also all existing aggregation data cleared.

Returns {error, {unknown_view, Name}} if Name view is unknown.