Help Center/ DataArts Studio/ API Reference/ Data Lake Mall APIs/ Overview APIs/ Querying Top N Services Used by an App
Updated on 2022-09-15 GMT+08:00

Querying Top N Services Used by an App

Function

This API is used to query top N services used by an app.

URI

GET /v1/{project_id}/service/statistic/apps-top-n

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

start_time

Yes

Long

Start time, which is a 13-digit timestamp

end_time

Yes

Long

End time, which is a 13-digit timestamp

time_unit

Yes

String

Time unit

Enumeration values:

  • HOUR

  • DAY

top_num

Yes

Integer

Top N

order_by

Yes

String

Sorting order

Enumeration values:

  • CALL_NUM

  • SUCCESS_NUM

  • FAIL_NUM

  • LEGAL_NUM

  • ILLEGAL_NUM

  • COST_TIME_AVG

  • SUCCESS_COST_TIME_AVG

  • FAIL_COST_TIME_AVG

  • SUCCESS_RATE

  • FAIL_RATE

  • LEGAL_RATE

  • ILLEGAL_RATE

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

IAM Token

Workspace

No

String

Workspace ID

Dlm-Type

Yes

String

DLM edition

Enumeration values:

  • SHARED

  • EXCLUSIVE

Response Parameters

Status code: 204

Table 4 Response body parameters

Parameter

Type

Description

statistics

Array of StatisticForDetail objects

Statistics details

Table 5 StatisticForDetail

Parameter

Type

Description

id

String

Statistics object ID

name

String

Statistics object name

call_num

Integer

Number of calls

success_num

Integer

Number of successful calls (data obtained)

fail_num

Integer

Number of failed calls (failed to obtain data)

legal_num

Integer

Number of legal calls (verification passed)

illegal_num

Integer

Number of illegal calls (failed to pass verification)

cost_time_avg

Number

Average request duration

success_cost_time_avg

Number

Average duration of successful requests

fail_cost_time_avg

Number

Average duration of failed requests

success_rate

Number

Success rate

fail_rate

Number

Failure rate

legal_rate

Number

Rate of legal calls

illegal_rate

Number

Rate of illegal calls

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Requests

None

Example Responses

Status code: 204

Top N services used by an app are obtained.

{
  "statistics" : [ {
    "id" : "3423634676234236674",
    "name" : "Name of the statistics object",
    "call_num" : 0,
    "success_num" : 0,
    "fail_num" : 0,
    "legal_num" : 0,
    "illegal_num" : 0,
    "cost_time_avg" : 0,
    "success_cost_time_avg" : 0,
    "fail_cost_time_avg" : 0,
    "success_rate" : 0,
    "fail_rate" : 0,
    "legal_rate" : 0,
    "illegal_rate" : "0\r"
  } ]
}

Status Codes

Status Code

Description

204

Top N services used by an app are obtained.

400

BadRequest