本文簡要介紹 python 語言中 arcgis.gis.server.ReportManager.quick_report
的用法。
用法:
quick_report(since='LAST_WEEK', queries='services/', metrics='RequestsFailed')
返回:
成功查詢的 Python 數據字典。
為服務、服務或文件夾生成動態使用情況報告。
Parameter
Description
since
可選字符串。報告的持續時間。支持的值為:LAST_DAY、LAST_WEEK、LAST_MONTH 或 LAST_YEAR。
LAST_DAY
表示跨越前 24 小時的時間範圍。這是默認值。LAST_WEEK
表示跨越前 7 天的時間範圍。LAST_MONTH
表示跨越前 30 天的時間範圍。LAST_YEAR
表示跨越前 365 天的時間範圍。
queries
必需的字符串。要為其生成報告的資源URI 字符串。指定為要為其收集指標的服務或文件夾的逗號分隔字符串。
services/
- Entire Siteservices/Folder/
- Folder within a Site. Reports metrics aggregated across all services within that Folder and Sub-Folders.services/Folder/ServiceName.ServiceType
- Service in a specified folder, for example:services/Folder_Name/Map_bv_999.MapServer
services/Fodler_Name/ServiceName.ServiceType
root folder
- Service in the root folderMap_bv_999.MapServer.
queries="services/Hydroligic_Data/Lake_algae.FeatureServer,services/Mountains"
metrics
可選字符串。要報告的指標的逗號分隔列表。
支持的指標是:
RequestCount - the number of requests received
RequestsFailed - the number of requests that failed
RequestsTimedOut - the number of requests that timed out
RequestMaxResponseTime - the maximum response time
RequestAvgResponseTime - the average response time
ServiceActiveInstances - the maximum number of active (running) service instances sampled at 1 minute intervals, for a specified service
metrics="RequestCount,RequestsFailed"
例子:
# Usage Example: >>> gis = GIS(profile="my_own_portal", verify_cert=False) >>> gis_servers = gis.admin.servers.list() >>> srv = gis_servers[0] >>> query_string = "services/Forests/Forests_degraded_2000.MapServer,services/Lakes/Lakes_drought_levels.MapServer" >>> qk_report = srv.usage.quick_report(since = "LAST_MONTH", queries = query_string, metrics = "RequestCount,RequestsFailed") >>> qk_report {'report': {'reportname': '1fa828eb31664485ae5c25c76c86e28d', 'metadata': '{"temp":true,"title":"1fa828eb31664485ae5c25c76c86e28d","managerReport":false}', 'time-slices': [1598914800000, 1599001200000, 1599087600000, ... 1601420400000], 'report-data': [[{'resourceURI': 'services/Forests/Forests_degraded_2000.MapServer', 'metric-type': 'RequestCount', 'data': [None, 17, 928, ... 20]}, {'resourceURI': 'services/Forests/Forests_degraded_2000.MapServer', 'metric-type': 'RequestsFailed', 'data': [None, 225, None, ... 0]}, {'resourceURI': 'services/Lakes/Lakes_drought_levels.MapServer', 'metric-type': 'RequestCount', 'data': [0, 0, 7, ... 71]}, {'resourceURI': 'services/Lakes/Lakes_drought_levels.MapServer', 'metric-type': 'RequestsFailed', 'data': [None, None, 1 ... , 0]}]]}}
相關用法
- Python ArcGIS ReportManager.create用法及代碼示例
- Python ArcGIS Report.query用法及代碼示例
- Python ArcGIS ResourceManager.get用法及代碼示例
- Python ArcGIS ResourceManager.add用法及代碼示例
- Python ArcGIS RealTimeAnalyticsManager.get用法及代碼示例
- Python ArcGIS RealTimeAnalytics.status用法及代碼示例
- Python ArcGIS RealTimeAnalytics.metrics用法及代碼示例
- Python ArcGIS RealTimeAnalytics.start用法及代碼示例
- Python ArcGIS ResourceManager.update用法及代碼示例
- Python ArcGIS RealTimeAnalyticsManager.items用法及代碼示例
- Python ArcGIS ResourceManager.remove用法及代碼示例
- Python ArcGIS ResourceManager.export用法及代碼示例
- Python ArcGIS RealTimeAnalytics.delete用法及代碼示例
- Python ArcGIS RealTimeAnalytics.stop用法及代碼示例
- Python ArcGIS RunInterval用法及代碼示例
- Python ArcGIS Raster.remove_variables用法及代碼示例
- Python ArcGIS Raster.export_image用法及代碼示例
- Python ArcGIS Raster.get_dimension_values用法及代碼示例
- Python ArcGIS Raster.get_dimension_attributes用法及代碼示例
- Python ArcGIS Raster.read用法及代碼示例
- Python ArcGIS Raster.append_slices用法及代碼示例
- Python ArcGIS Raster.summarize用法及代碼示例
- Python ArcGIS RoleManager用法及代碼示例
- Python ArcGIS RasterManager.add用法及代碼示例
- Python ArcGIS Raster.get_variable_attributes用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.gis.server.ReportManager.quick_report。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。