Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

CDN Dashboard Templates

Updated on 2025-01-24 GMT+08:00

CDN logs the requests to all domain names including those deleted. You can ingest these logs to LTS to analyze the access to your service resources in detail. If you have enabled the enterprise project function, log management is not available for deleted domain names.

CDN dashboard templates support Viewing CDN Error Analysis, Viewing CDN Basic Data, Viewing CDN User Analysis, and Viewing Popular CDN Resources.

Prerequisites

Viewing CDN Error Analysis

  1. Log in to the LTS console. In the navigation pane, choose Dashboards.
  2. Choose CDN dashboard templates under Dashboard Templates and click CDN Error Analysis to view the chart details.

    • Top 5 Domain Name Errors. The associated query and analysis statement is:
      select domain , count(*) as c where http_code > 400 group by domain order by c desc limit 5
    • Top 5 URI Errors. The associated query and analysis statement is:
      select uri , count(*) as c where http_code > 400 group by uri order by c desc limit 5
    • Status Codes. The associated query and analysis statement is:
      select http_code , count(*) as c where http_code > 400 group by http_code order by c desc
    • Errors by Carrier. The associated query and analysis statement is:
      select ip_to_provider(client_ip) as isp , count(*) as c where http_code > 400 group by isp having ip_to_provider(client_ip) != '' order by c desc limit 10
    • Errors by Client. The associated query and analysis statement is:
      select user_agent as "Client version", count(*) as "Errors" where http_code > 400 group by user_agent order by "Errors" desc limit 10
    • Errors by Province. The associated query and analysis statement is:
      select ip_to_province(client_ip) as province , count(*) as c where http_code > 400 and  IP_TO_COUNTRY (client_ip) = 'China' group by province order by c desc limit 50
    • 4XX Errors. The associated query and analysis statement is:
      SELECT
            province AS "Province",
            isp AS "Carrier",
            c AS "Errors",
            round( c * 100.0 / sum( c ), 2 ) AS "Rate (%)" 
           FROM
            (
            SELECT
             ip_to_province ( client_ip ) AS province,
             ip_to_provider ( client_ip ) AS isp,
             count(*) AS c 
            FROM
             log 
            WHERE
             http_code >= 400 
             AND http_code < 500 
            GROUP BY
             province,
             isp 
            HAVING
             (
             ip_to_provider ( client_ip )) != '' 
            ORDER BY
             c DESC 
            ) 
           GROUP BY
            province,
            isp,
            c
    • 5XX Errors. The associated query and analysis statement is:
      SELECT
            province AS "Province",
            isp AS "Carrier",
            c AS "Errors",
            round( c * 100.0 / sum( c ), 2 ) AS "Rate (%)" 
           FROM
            (
            SELECT
             ip_to_province ( client_ip ) AS province,
             ip_to_provider ( client_ip ) AS isp,
             count(*) AS c 
            FROM
             log 
            WHERE
                 http_code >= 500
            GROUP BY
             province,
             isp 
            HAVING
             (
             ip_to_provider ( client_ip )) != '' 
            ORDER BY
             c DESC 
            ) 
           GROUP BY
            province,
            isp,
            c
    • Errors by Country. The associated query and analysis statement is:
      select ip_to_country(client_ip) as country , count(*) as c where http_code > 400  group by country order by c desc limit 50

Viewing CDN Basic Data

  1. Log in to the LTS console. In the navigation pane, choose Dashboards.
  2. Choose CDN dashboard templates under Dashboard Templates and click CDN Basic Data to view the chart details.

    • Cache Hit Ratio. The associated query and analysis statement is:
      select round(diff[1],2) as Hit_ratio, round(diff[2],2) as diff, round((diff[3]-1)*100, 2) from (select compare(Hit_ratio, 86400) as diff from (select sum(s) * 100.0/count(*) as Hit_ratio from (select case when hit_info = 'HIT' then 1 else 0 end as s from log)))
    • Download Speed. The associated query and analysis statement is:
      select round(diff[1],2) as speed, round(diff[2],2) as diff, round((diff[3]-1)*100, 2) from (select compare(speed, 86400) as diff from (select sum(response_size) * 1.0 /sum(response_time) as speed from log ))
    • Status Codes. The associated query and analysis statement is:
      select http_code , count(*) as c group by http_code order by c desc
    • Latency Distribution. The associated query and analysis statement is:
      select 
            case when response_time < 100 then '~100ms' 
            when response_time < 500 then '100~500ms' 
            when response_time < 1000 then '500ms~1s' 
            when response_time < 5000 then '1~5s' 
            when response_time < 6000 then '5~6s' 
            when response_time < 7000 then '6~7s' 
            when response_time < 8000 then '7~8s'
            when response_time < 10000 then '8~10s'
            when response_time < 15000 then '10~15s' 
            else '15s~' end as latency , 
            count(*) as cnt 
            group by latency 
            order by  cnt  
    • Request Bandwidth. The associated query and analysis statement is:
      select TIME_FORMAT (TIME_FLOOR(__time,'PT1M'), 'HH:mm', '+08:00') as thisdate, 
            sum(response_size) * 8/1000000000.0 as "Bandwidth (Gbit/min)" 
            group by TIME_FLOOR(__time,'PT1M') 
            order by TIME_FLOOR(__time,'PT1M')
    • Visits and Users. The associated query and analysis statement is:
      select TIME_FORMAT (TIME_FLOOR(__time,'PT1M'), 'HH:mm', '+08:00') as thisdate, 
            count(*) as pv, APPROX_COUNT_DISTINCT(client_ip) as uv group by TIME_FLOOR(__time,'PT1M') order by TIME_FLOOR(__time,'PT1M')
    • Average Latency. The associated query and analysis statement is:
      select TIME_FORMAT (TIME_FLOOR(__time,'PT1M'), 'HH:mm', '+08:00') as thisdate, 
            avg(response_time) as "Average Latency (ms)" group by TIME_FLOOR(__time,'PT1M') order by TIME_FLOOR(__time,'PT1M')
    • Request Hit Ratio. The associated query and analysis statement is:
      select 
            TIME_FORMAT (TIME_FLOOR(m_time,'PT1M'), 'HH:mm', '+08:00' ) as thisdate , 
            sum(is_hit)*100.0/count(*) as hit_ratio 
            from  (select  TIME_FLOOR(__time,'PT1M') as m_time ,  case when hit_info = 'HIT' 
             then 1 else 0 end as is_hit from log ) group by m_time order by m_time

Viewing CDN User Analysis

  1. Log in to the LTS console. In the navigation pane, choose Dashboards.
  2. Choose CDN dashboard templates under Dashboard Templates and click CDN User Analysis to view the chart details.

    • Visits. The associated query and analysis statement is:
      select diff[1] as pv,diff[2] as diff, round(100*(diff[3]-1), 2) from (select compare(pv, 86400) as diff from (select count(*) as pv from log))
    • Visitors. The associated query and analysis statement is:
      select diff[1] as uv, diff[2] as diff, round((diff[3]-1)*100, 2) from (select compare(uv , 86400) as diff from (select APPROX_COUNT_DISTINCT(client_ip) as uv from log))
    • Visits by Client. The associated query and analysis statement is:
      select ua as "Client" , sum(c) as "Visits" from (select case when strpos(ua , 'iphone') > 1 then 'iphone' when strpos(ua, 'ipad') > 1 then 'ipad' when strpos(ua, 'android') > 1 then 'android' when strpos(ua, 'windows') > 1 then 'windows' when strpos(ua , 'mac') > 1 then 'mac' when strpos(ua, 'linux') > 1 then 'linux' else ua end as ua , c from (select count(*) as c , lower(user_agent) as ua from log group by ua order by c desc limit 2000) ) group by "Client" order by "Visits" desc limit 100
    • Visits by Carrier. The associated query and analysis statement is:
      select ip_to_provider(client_ip) as isp ,count(*) as "Visits" group by isp order by "Visits" desc limit 100
    • Visits by Geography. The associated query and analysis statement is:
      select ip_to_province(client_ip) as province , count(*) as cnt where IP_TO_COUNTRY (client_ip) = 'China' group by province HAVING province not in ('','Reserved address','*') order by cnt desc limit 100
    • Top Valid Visitors. The associated query and analysis statement is:
      SELECT  CASE    WHEN ip_to_country(client_ip) = 'Shanghai' THEN concat(client_ip, ' ( shanghai )')    WHEN ip_to_province(client_ip) = '' THEN concat(client_ip, ' ( Unknown IP )')    WHEN ip_to_provider(client_ip) = 'Private IP' THEN concat(client_ip, ' ( Private IP )')    ELSE concat(      client_ip,      ' ( ',      ip_to_country(client_ip),      '/',      ip_to_province(client_ip),      '/',      CASE        WHEN ip_to_city(client_ip) = '-1' THEN 'Unknown city'        ELSE ip_to_city(client_ip)      END,      ' ',      ip_to_provider(client_ip),      ' )'    )  END AS client,  pv as "Total Visits",  (pv - success_count) as "Errors",  round( CASE WHEN "throughput" > 0 THEN "throughput" ELSE 0 END, 1 ) AS "Total Downloads (GB)"from  (    select      client_ip,      count(*) as pv,      sum(response_size) / 1024.0 / 1024 / 1024.0 AS throughput,      sum(        CASE          WHEN http_code < 400 THEN 1          ELSE 0        END      ) AS success_count     from      log     group by      client_ip     order by      success_count desc    limit      100  )
    • Top Visitors by Downloads. The associated query and analysis statement is:
      SELECT CASE WHEN ip_to_country(client_ip)='Shanghai' THEN concat(client_ip, ' ( shanghai )') WHEN ip_to_province(client_ip)='' THEN concat(client_ip, ' ( Unknown IP )') WHEN ip_to_provider(client_ip)='Private IP' THEN concat(client_ip, ' ( Private IP )') ELSE concat(client_ip, ' ( ', ip_to_country(client_ip), '/', ip_to_province(client_ip), '/',        CASE WHEN ip_to_city(client_ip)='-1' THEN 'Unknown city' ELSE ip_to_city(client_ip) END, ' ',ip_to_provider(client_ip), ' )') END AS client,        pv as "Total Visits",        error_count as "Errors" ,      round( CASE WHEN "throughput" > 0 THEN "throughput" ELSE 0 END, 1 ) AS "Total Downloads (GB)"      from (      select client_ip ,        count(*) as pv,        sum(response_size)/1024.0/1024/1024.0 AS throughput ,        sum(CASE WHEN http_code > 400 THEN 1 ELSE 0 END) AS error_count        from log        group by client_ip       order by throughput desc        limit 100)

Viewing Popular CDN Resources

  1. Log in to the LTS console. In the navigation pane, choose Dashboards.
  2. Choose CDN dashboard templates under Dashboard Templates and click Popular CDN Resources to view the chart details.

    • 5 Most Visited Domain Names. The associated query and analysis statement is:
      select domain ,count(*) as cnt group by domain order by cnt desc limit 5
    • 5 Most Downloaded Domain Names. The associated query and analysis statement is:
      select domain , sum(response_size) as "Total Downloads" group by domain order by "Total Downloads" desc limit 5
    • Popular Visits (URI). The associated query and analysis statement is:
      select uri as URI, "Visits", "Visitors", round( CASE WHEN "Total Downloads (GB)" > 0 THEN "Total Downloads (GB)" ELSE 0 END, 2 ) AS "Total Downloads (GB)" from (        select uri ,count(*) as "Visits" , APPROX_COUNT_DISTINCT(client_ip) as "Visitors", sum(response_size)/1024.0/1024.0/1024.0 as "Total Downloads (GB)" where http_code < 400 group by uri order by "Visits" desc limit 100)
    • Popular Visits (Source). The associated query and analysis statement is:
      select refer_domain as "Referer",c as "Times",uv as "Users", round(c * 100.0 / sum(c), 2) as  "Percentage"  from (select refer_domain as refer_domain,count(*) as c,APPROX_COUNT_DISTINCT(client_ip) as uv from log where refer_domain != '' group by refer_domain order by c desc limit 100 ) GROUP BY refer_domain, c, uv
    • Visits by Geography. The associated query and analysis statement is:
      select ip_to_province(client_ip) as province , count(*) as cnt where IP_TO_COUNTRY (client_ip) = 'China' group by province HAVING province not in ('','Reserved address','*') order by cnt desc limit 1000
    • Download Speed by Geography. The associated query and analysis statement is:
      select province, round( CASE WHEN "speed" > 0 THEN "speed" ELSE 0 END, 3 ) AS "speed" from (select ip_to_province(client_ip) as province , sum(response_size)* 1.0 /(sum(response_time)+1) as "speed" , count(*) as c where IP_TO_COUNTRY (client_ip) = 'China' group by province HAVING province not in ('','Reserved address','*') order by c desc limit 40)
    • Statistics by Province. The associated query and analysis statement is:
      select ip_to_province(client_ip) as "Province" ,count(*) as "Visits", sum(response_size)/1024.0/1024.0/1024.0 as "Total Downloads (GB)" , sum(response_size) * 1.0 /sum(response_time) as "Download Speed (KB/s)" group by "Province" having ip_to_province(client_ip) != '' order by "Total Downloads (GB)" desc limit 200
    • Carrier Traffic and Speed. The associated query and analysis statement is:
      select ip_to_provider(client_ip) as isp , sum(response_size)* 1.0 /(sum(response_time)+1) as "Download Speed (KB/s)" , sum(response_size)/1024.0/1024.0/1024.0 as "Total Downloads (GB)", count(*) as c group by isp having ip_to_provider(client_ip) != '' order by c desc limit 10
    • Statistics by Carrier. The associated query and analysis statement is:
      select "Carrier", "Visits", round( CASE WHEN "Total Downloads (GB)" > 0 THEN "Total Downloads (GB)" ELSE 0 END, 2 ) AS "Total Downloads (GB)",        round( CASE WHEN "Download Speed (KB/s)" > 0 THEN "Download Speed (KB/s)" ELSE 0 END, 2 ) AS "Download Speed (KB/s)" from (      select ip_to_provider(client_ip) as "Carrier" ,count(*) as "Visits", sum(response_size)/1024.0/1024.0/1024.0 as "Total Downloads (GB)" , sum(response_size) * 1.0 /sum(response_time) as "Download Speed (KB/s)" group by "Carrier" having ip_to_provider(client_ip) != '' and "Carrier" not in ('*') order by "Total Downloads (GB)" desc limit 200)

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback