Skip to main content

Perfsight OpenAPI

1 signature

1.1 signature parameters

nametyperequeireddescription
access_tokenstringyestoken generated by PerfSight, click to get
envstringyesChina enviroment: v2; Singapore environment: sgp;
app_idstringyesProject ID
usernamestringyesUsername 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,
}
  1. Set the token expiration time (take 120 seconds as an example)
exp = int(time.time() + 120)
  1. Add exp to parameters
payload = {
"platform": 0,
"exp": exp
}
  1. Use jwt to generate token
headers = {
"alg": "HS256",
"typ": "JWT"
}
jwt_token = jwt.encode(payload=payload, key=access_token, algorithm='HS256', headers=headers)

  1. Construct request parameters
params = {
'app_id': "123",
'env': 'sgp',
'username': 'abc',
'token': jwt_token,
}
  1. 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())
  1. 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:

nametyperequeireddescription
platformintyesplatform ID, Android:0, iOS:1, PC:5
project_versionstringyesversion
scenestringyesscene name
is_customizeboolyeswhether to use custom image quality
customize_arrarrayyescustom image quality array
regionstringyescountry/region
startstringyesfrom time format:"2023-02-20 00:00:00"
endstringyesend time format:"2023-02-20 00:00:00"
time_levelintyes1:summary, 4:time range
"is_customize": true
"customize_arr": [
{
"category": "device classification",
"category_items": ["1st Gear"]
},
{
"category": "target fps",
"category_items": ["high"]
}
],

response:

nametypedescription
merge_countintGame Number
fps_meanfloatAvg(FPS)
fps_jetter_hourfloatAvg(FPS Jitter)
fps_jank_hourfloatAvg(FPS Jank)
pss_average_peakfloatAvg(Max(PSS Memory))
vss_average_peakfloatAvg(Max(VSS Memory))
perfdog_small_jankfloatAvg(Perfdog Jank)
frametime_gt_100ms_percentfloatPercent(FrameTime > 100ms / Frames)
mono_reserved_peakfloatMax(MONO memory)

2.2 get model analysis data

path:/openapi/device/deviceAnalysis

method:POST

request body:

nametyperequeireddescription
platformintyesplatform ID, Android:0, iOS:1, PC:5
project_versionstringyesversion
scenestringyesscene name
is_customizeboolyeswhether to use custom image quality
customize_arrarrayyescustom image quality array
device_classarrayyesdevice classification,array of int; 0:comprehensive, 1:high, 2:medium, 3:low
device_searcharrayyesmodel, array of string
regionstringyescountry/region
startstringyesfrom time format:"2023-02-20 00:00:00"
endstringyesend time format:"2023-02-20 00:00:00"
time_levelintyes1:summary, 4:time range
"customize_arr": [
{
"category": "device classification",
"category_items": ["1st Gear"]
},
{
"category": "target fps",
"category_items": ["high"]
}
],

response:

nametypedescription
calendar_timestringtime
device_modelstringmodel
ramintRam
device_cpu_coreintcpu cores
osstring
device_cpu_freqintcpu frequency
gpu_rendererstringgpu
gpu_versionstringgpu version
device_manustringmanu
scene_labelstringscene name
def_classintcustomized device classification
merge_countintgame number
qualitystringquality
benchmark_main_topstringbenchmark device classification
region_idintcountry/region ID
region_namestringcountry/region name
cpu_avgfloatAvg(CPU Utilization)
avg_online_timefloatAvg(online time)
count_ratefloatPercent(game number of sub scene)
x64_supportstringwhether to support x64
fps_meanfloatAvg(FPS)
fps_jetter_hourfloatAvg(FPS Jitter)
fps_low_hourfloatTimes of Low FPS
fps_jank_hourfloatAvg(FPS Jank)
perfdog_small_jankfloatAvg(Perfdog Jank)
perfdog_big_jankfloatAvg(Perfdog BigJank)
frametime_gt_100ms_percentfloatPercent(FrameTime > 100ms / Frames)
cpu_decline_percentfloatPercentage of CPU Throttling Game Number
stutterfloatStutter
fps_attainmentfloatFrame Rate Compliance Rate
fps_section1floatFPS Segment 1
fps_section2floatFPS Segment 2
fps_section3floatFPS Segment 3
fps_section4floatFPS Segment 4
fps_section5floatFPS Segment 5
pss_average_peakfloatAvg(Max(PSS Memory))
pss_average_peak_top1floatAvg(Max(Top 1% PSS Memory))
pss_peak_peakfloatMax(Max(PSS Memory))
vss_average_peakfloatAvg(Max(VSS Memory))
vss_average_peak_top1floatAvg(Max(Top 1% VSS Memory))
vss_peak_peakfloatMax(Max(VSS Memory))
dist_datamapSegment data
cpu_meanfloat64CPU Average
current_meanfloat64Average Current
power_meanfloat64Average Power Consumption
power_consumptionfloat64Electricity Consumption
cpu_temperateure_meanfloat64Average cpu temperature
battery_temperature_meanfloat64average battery temperature
loading_timefloatscene Loading Time
loading_tiem_mean_r1000floatScene Loading Time
mean_scene_timeintScene Duration