Perfsight OpenAPI
1 signature
1.1 signature parameters
name | type | requeired | description |
---|---|---|---|
access_token | string | yes | token generated by PerfSight, click to get |
env | string | yes | China enviroment: v2; Singapore environment: sgp; |
app_id | string | yes | Project ID |
username | string | yes | Username to log in to the PerfSight platform |
1.2 signature method
Taking python as an example, assume that the actual parameters of api are
payload = {
"platform": 0,
}
- Set the token expiration time (take 120 seconds as an example)
exp = int(time.time() + 120)
- Add exp to parameters
payload = {
"platform": 0,
"exp": exp
}
- Use jwt to generate token
headers = {
"alg": "HS256",
"typ": "JWT"
}
jwt_token = jwt.encode(payload=payload, key=access_token, algorithm='HS256', headers=headers)
- Construct request parameters
params = {
'app_id': "123",
'env': 'sgp',
'username': 'abc',
'token': jwt_token,
}
- Send request
headers = {'Content-Type': 'application/json'}
url = 'http://9.134.150.248:8086/openapi/scene/dayAggregateData'
response = requests.post(url, json=params, headers=headers)
print(response.json())
- Format of response
{
{
"ret": 200, // return code
"msg": "", // error message
"data": [ // data
{
"merge_count": 581179108,
"fps_mean": 52.56,
"fps_swing_hour": 11.03,
"jank_frame_hour": 5.99,
"pss": 1425.3,
"vss": 12507.61,
"psmall_jank": 3.51,
"frame100": 0.02,
"mono": 183.34
}
],
"requestid": "94e2ac8b38b08ec238d492a708e3d023", // Server request ID
"flush_time": "2023-02-24 17:21:54" // response time
}
}
1.3 request url
China: https://api.perfsight.qq.com
IEGG: http://101.32.118.205:80
2 api description and instructions
2.1 get scene analysis summary/time range data
path:/openapi/scene/dayAggregateData
method:POST
request body:
name | type | requeired | description |
---|---|---|---|
platform | int | yes | platform ID, Android:0, iOS:1, PC:5 |
project_version | string | yes | version |
scene | string | yes | scene name |
is_customize | bool | yes | whether to use custom image quality |
customize_arr | array | yes | custom image quality array |
region | string | yes | country/region |
start | string | yes | from time format:"2023-02-20 00:00:00" |
end | string | yes | end time format:"2023-02-20 00:00:00" |
time_level | int | yes | 1:summary, 4:time range |
"is_customize": true
"customize_arr": [
{
"category": "device classification",
"category_items": ["1st Gear"]
},
{
"category": "target fps",
"category_items": ["high"]
}
],
response:
name | type | description |
---|---|---|
merge_count | int | Game Number |
fps_mean | float | Avg(FPS) |
fps_jetter_hour | float | Avg(FPS Jitter) |
fps_jank_hour | float | Avg(FPS Jank) |
pss_average_peak | float | Avg(Max(PSS Memory)) |
vss_average_peak | float | Avg(Max(VSS Memory)) |
perfdog_small_jank | float | Avg(Perfdog Jank) |
frametime_gt_100ms_percent | float | Percent(FrameTime > 100ms / Frames) |
mono_reserved_peak | float | Max(MONO memory) |
2.2 get model analysis data
path:/openapi/device/deviceAnalysis
method:POST
request body:
name | type | requeired | description |
---|---|---|---|
platform | int | yes | platform ID, Android:0, iOS:1, PC:5 |
project_version | string | yes | version |
scene | string | yes | scene name |
is_customize | bool | yes | whether to use custom image quality |
customize_arr | array | yes | custom image quality array |
device_class | array | yes | device classification,array of int; 0:comprehensive, 1:high, 2:medium, 3:low |
device_search | array | yes | model, array of string |
region | string | yes | country/region |
start | string | yes | from time format:"2023-02-20 00:00:00" |
end | string | yes | end time format:"2023-02-20 00:00:00" |
time_level | int | yes | 1:summary, 4:time range |
"customize_arr": [
{
"category": "device classification",
"category_items": ["1st Gear"]
},
{
"category": "target fps",
"category_items": ["high"]
}
],
response:
name | type | description |
---|---|---|
calendar_time | string | time |
device_model | string | model |
ram | int | Ram |
device_cpu_core | int | cpu cores |
os | string | |
device_cpu_freq | int | cpu frequency |
gpu_renderer | string | gpu |
gpu_version | string | gpu version |
device_manu | string | manu |
scene_label | string | scene name |
def_class | int | customized device classification |
merge_count | int | game number |
quality | string | quality |
benchmark_main_top | string | benchmark device classification |
region_id | int | country/region ID |
region_name | string | country/region name |
cpu_avg | float | Avg(CPU Utilization) |
avg_online_time | float | Avg(online time) |
count_rate | float | Percent(game number of sub scene) |
x64_support | string | whether to support x64 |
fps_mean | float | Avg(FPS) |
fps_jetter_hour | float | Avg(FPS Jitter) |
fps_low_hour | float | Times of Low FPS |
fps_jank_hour | float | Avg(FPS Jank) |
perfdog_small_jank | float | Avg(Perfdog Jank) |
perfdog_big_jank | float | Avg(Perfdog BigJank) |
frametime_gt_100ms_percent | float | Percent(FrameTime > 100ms / Frames) |
cpu_decline_percent | float | Percentage of CPU Throttling Game Number |
stutter | float | Stutter |
fps_attainment | float | Frame Rate Compliance Rate |
fps_section1 | float | FPS Segment 1 |
fps_section2 | float | FPS Segment 2 |
fps_section3 | float | FPS Segment 3 |
fps_section4 | float | FPS Segment 4 |
fps_section5 | float | FPS Segment 5 |
pss_average_peak | float | Avg(Max(PSS Memory)) |
pss_average_peak_top1 | float | Avg(Max(Top 1% PSS Memory)) |
pss_peak_peak | float | Max(Max(PSS Memory)) |
vss_average_peak | float | Avg(Max(VSS Memory)) |
vss_average_peak_top1 | float | Avg(Max(Top 1% VSS Memory)) |
vss_peak_peak | float | Max(Max(VSS Memory)) |
dist_data | map | Segment data |
cpu_mean | float64 | CPU Average |
current_mean | float64 | Average Current |
power_mean | float64 | Average Power Consumption |
power_consumption | float64 | Electricity Consumption |
cpu_temperateure_mean | float64 | Average cpu temperature |
battery_temperature_mean | float64 | average battery temperature |
loading_time | float | scene Loading Time |
loading_tiem_mean_r1000 | float | Scene Loading Time |
mean_scene_time | int | Scene Duration |