Module: UU::OperationalStats::OperationalStats

Extended by:
OperationalStats
Included in:
OperationalStats
Defined in:
uu_operational_stats-0.1.7/lib/uu/operational_stats/operational_stats.rb,
uu_operational_stats-0.1.7/lib/uu/operational_stats/operational_stats/operational_stats_entity_type.rb,
uu_operational_stats-0.1.7/lib/uu/operational_stats/operational_stats/operational_stats_territory_record.rb,
uu_operational_stats-0.1.7/lib/uu/operational_stats/operational_stats/operational_stats_get_territory_record_list.rb

Overview

Module Operational Stats.

Defined Under Namespace

Classes: OperationalStatsEntityType, OperationalStatsGetTerritoryRecordList, OperationalStatsTerritoryRecord

Constant Summary

PATH =

Service path

'ues/stats/operationalstats'

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::REST::ResultList<OperationalStats::OperationalStatsTerritoryRecord, OperationalStats::OperationalStatsGetTerritoryRecordList>) get_territory_record_list(store_uri, criteria = nil)

Returns a list of territory stats records from the specified Stats Store. Records are filtered, grouped and ordered by the query criteria. Result list cannot be paged. The maximum number of records returned is 10,000. In case of exceeding the limit, an exception is thrown.

Examples:

# Get sheet and attachment stats for all meta artifacts of specified application
# in specified territory from March 2015, order records from newest to oldest 
# and then by meta artifact and entity type
UU::OperationalStats::OperationalStats.get_territory_record_list(
  "ues:TERRITORY[123456]:OPERATIONAL_STATS_STORE[987654]:",
  :time_from => '2015-03-01',
  :time_to => '2015-03-31',
  :query => "territoryUri = 'ues:[123456]:[123456]:' " +
      "AND applicationCode = 'VENDOR_CODE.APP_CODE' " +
      "AND entityType IN ('sheet', 'attachment') " +
      "GROUP BY metaArtifactCode, entityType " +
      "ORDER BY time DESC, metaArtifactCode, entityType"
)

Parameters:

Options Hash (criteria):

  • :query (String)

    Not nil. Query in uuQuery 2.0 format. Supported clauses: conditions, GROUP BY, ORDER BY. Records can be filtered by all dimensions except for time (use time_from, time_to instead) and must be filtered by at least one of dimensions territoryUri, applicationCode, metaArtifactCode. Records can be grouped by all dimensions except for time. Records can be ordered by all dimensions. Default ordering: time ASC, territoryUri ASC, applicationCode ASC, metaArtifactCode ASC, entityType ASC. Supported dimensions: time (ISO 8601 format), territoryUri (canonical UESURI ues:[TER_OID]:[TER_OID]:), applicationCode, metaArtifactCode, entityType (short code according to OperationalStatsEntityType).

  • :time_from (String)

    Not nil. Beginning of the time interval. The entered value must be in the ISO 8601 format. Interval between time_from and time_to must not exceed 366 days.

  • :time_to (String)

    Not nil. End of the time interval. The entered value must be in the ISO 8601 format. Interval between time_from and time_to must not exceed 366 days.

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
57
# File 'uu_operational_stats-0.1.7/lib/uu/operational_stats/operational_stats.rb', line 47

def get_territory_record_list(store_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(OperationalStats)
  dto = OperationalStats::OperationalStatsGetTerritoryRecordList.new(criteria)
  svc.add_parameter('timeFrom', dto.time_from)
  svc.add_parameter('timeTo', dto.time_to)
  svc.add_parameter('query', dto.query)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getTerritoryRecordList', store_uri)
    return UU::OS::REST::ResultList.new(OperationalStats::OperationalStatsGetTerritoryRecordList, OperationalStats::OperationalStatsTerritoryRecord, res)
  end
end