feat: show traffic purpose labels
This commit is contained in:
parent
a65757aedc
commit
6bfc408772
@ -36,9 +36,22 @@ interface PublicTrafficStats {
|
||||
totalRequests: number
|
||||
statusCounts: Record<string, number>
|
||||
}>
|
||||
byPurpose: Array<{
|
||||
key: string
|
||||
label: string
|
||||
category: string
|
||||
detail: string
|
||||
responseBytes: number
|
||||
requestBytes: number | null
|
||||
requestBytesKnownCount: number
|
||||
totalRequests: number
|
||||
}>
|
||||
topPaths: Array<{
|
||||
path: string
|
||||
method: string
|
||||
purposeLabel: string
|
||||
purposeCategory: string
|
||||
purposeDetail: string
|
||||
responseBytes: number
|
||||
totalRequests: number
|
||||
}>
|
||||
@ -306,12 +319,49 @@ export default function PublicTrafficTab({ showToast }: PublicTrafficTabProps) {
|
||||
</div>
|
||||
|
||||
<div className="rounded-xl border border-gray-200 bg-white p-5 shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
||||
<h3 className="mb-4 text-lg font-semibold text-gray-900 dark:text-white">流量最高路径</h3>
|
||||
<h3 className="mb-4 text-lg font-semibold text-gray-900 dark:text-white">流量用途汇总</h3>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="min-w-full divide-y divide-gray-200 text-sm dark:divide-gray-700">
|
||||
<thead>
|
||||
<tr className="text-left text-gray-500 dark:text-gray-400">
|
||||
<th className="px-3 py-2 font-medium">路径</th>
|
||||
<th className="px-3 py-2 font-medium">用途</th>
|
||||
<th className="px-3 py-2 font-medium">类别</th>
|
||||
<th className="px-3 py-2 text-right font-medium">响应流量</th>
|
||||
<th className="px-3 py-2 text-right font-medium">请求次数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
{stats.byPurpose.slice(0, 12).map((item) => (
|
||||
<tr key={item.key} className="text-gray-700 dark:text-gray-200">
|
||||
<td className="px-3 py-3">
|
||||
<div className="font-medium text-gray-900 dark:text-white">{item.label}</div>
|
||||
<div className="mt-1 max-w-[720px] text-xs text-gray-500 dark:text-gray-400">{item.detail}</div>
|
||||
</td>
|
||||
<td className="px-3 py-3 text-gray-500 dark:text-gray-400">{item.category}</td>
|
||||
<td className="px-3 py-3 text-right font-medium">{formatBytes(item.responseBytes)}</td>
|
||||
<td className="px-3 py-3 text-right">{formatNumber(item.totalRequests)}</td>
|
||||
</tr>
|
||||
))}
|
||||
{stats.byPurpose.length === 0 && (
|
||||
<tr>
|
||||
<td colSpan={4} className="px-3 py-6 text-center text-gray-500 dark:text-gray-400">
|
||||
当前范围没有用途数据。
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="rounded-xl border border-gray-200 bg-white p-5 shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
||||
<h3 className="mb-4 text-lg font-semibold text-gray-900 dark:text-white">流量最高路径明细</h3>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="min-w-full divide-y divide-gray-200 text-sm dark:divide-gray-700">
|
||||
<thead>
|
||||
<tr className="text-left text-gray-500 dark:text-gray-400">
|
||||
<th className="px-3 py-2 font-medium">用途和原始路径</th>
|
||||
<th className="px-3 py-2 font-medium">类别</th>
|
||||
<th className="px-3 py-2 font-medium">方法</th>
|
||||
<th className="px-3 py-2 text-right font-medium">响应流量</th>
|
||||
<th className="px-3 py-2 text-right font-medium">请求次数</th>
|
||||
@ -320,15 +370,22 @@ export default function PublicTrafficTab({ showToast }: PublicTrafficTabProps) {
|
||||
<tbody className="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
{stats.topPaths.map((item) => (
|
||||
<tr key={`${item.method}-${item.path}`} className="text-gray-700 dark:text-gray-200">
|
||||
<td className="max-w-[560px] truncate px-3 py-2" title={item.path}>{item.path}</td>
|
||||
<td className="px-3 py-2">{item.method}</td>
|
||||
<td className="px-3 py-2 text-right">{formatBytes(item.responseBytes)}</td>
|
||||
<td className="px-3 py-2 text-right">{formatNumber(item.totalRequests)}</td>
|
||||
<td className="px-3 py-3">
|
||||
<div className="font-medium text-gray-900 dark:text-white">{item.purposeLabel}</div>
|
||||
<div className="mt-1 text-xs text-gray-500 dark:text-gray-400">{item.purposeDetail}</div>
|
||||
<div className="mt-1 max-w-[640px] truncate font-mono text-xs text-gray-400" title={item.path}>
|
||||
{item.path}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-3 py-3 text-gray-500 dark:text-gray-400">{item.purposeCategory}</td>
|
||||
<td className="px-3 py-3">{item.method}</td>
|
||||
<td className="px-3 py-3 text-right">{formatBytes(item.responseBytes)}</td>
|
||||
<td className="px-3 py-3 text-right">{formatNumber(item.totalRequests)}</td>
|
||||
</tr>
|
||||
))}
|
||||
{stats.topPaths.length === 0 && (
|
||||
<tr>
|
||||
<td colSpan={4} className="px-3 py-6 text-center text-gray-500 dark:text-gray-400">
|
||||
<td colSpan={5} className="px-3 py-6 text-center text-gray-500 dark:text-gray-400">
|
||||
当前范围没有路径数据。
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
import { mkdtempSync, rmSync, writeFileSync } from 'fs'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import { getPublicTrafficStats, normalizeTrafficRange, parsePublicTrafficLogLine } from '@/lib/public-traffic-stats'
|
||||
import {
|
||||
classifyPublicTrafficPurpose,
|
||||
getPublicTrafficStats,
|
||||
normalizeTrafficRange,
|
||||
parsePublicTrafficLogLine,
|
||||
} from '@/lib/public-traffic-stats'
|
||||
|
||||
describe('public traffic stats', () => {
|
||||
test('parses standard nginx access log response bytes', () => {
|
||||
@ -68,6 +73,13 @@ describe('public traffic stats', () => {
|
||||
totalRequests: 1,
|
||||
}),
|
||||
])
|
||||
expect(stats.byPurpose).toEqual([
|
||||
expect.objectContaining({
|
||||
key: 'static-asset',
|
||||
label: '图片直链访问',
|
||||
category: '资源文件',
|
||||
}),
|
||||
])
|
||||
} finally {
|
||||
if (previousPaths === undefined) {
|
||||
delete process.env.PUBLIC_TRAFFIC_LOG_PATHS
|
||||
@ -77,4 +89,34 @@ describe('public traffic stats', () => {
|
||||
rmSync(tempDir, { recursive: true, force: true })
|
||||
}
|
||||
})
|
||||
|
||||
test('classifies technical paths into human-readable business purposes', () => {
|
||||
expect(classifyPublicTrafficPurpose('sc.jiansun.vip', '/api/materials/download', 'GET')).toEqual(
|
||||
expect.objectContaining({
|
||||
key: 'material-download',
|
||||
label: '素材下载/打包下载',
|
||||
}),
|
||||
)
|
||||
|
||||
expect(classifyPublicTrafficPurpose('cp.jiansun.vip', '/api/intake/non-integrated', 'GET')).toEqual(
|
||||
expect.objectContaining({
|
||||
key: 'product-intake-non-integrated',
|
||||
label: '产品设计平台未集成素材列表',
|
||||
}),
|
||||
)
|
||||
|
||||
expect(
|
||||
classifyPublicTrafficPurpose(
|
||||
's3.jiansun.vip',
|
||||
'/gongxiangpan/uploads/direct/d685fa51-d8eb-42ea-b471-4a91269a7a90/1783137399966-p0j9wv.jpg',
|
||||
'GET',
|
||||
),
|
||||
).toEqual(
|
||||
expect.objectContaining({
|
||||
key: 'direct-upload-asset',
|
||||
label: '图片直链访问',
|
||||
category: '直传资源',
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@ -26,6 +26,13 @@ export interface PublicTrafficLogEntry {
|
||||
requestBytes: number | null
|
||||
}
|
||||
|
||||
export interface PublicTrafficPurpose {
|
||||
key: string
|
||||
label: string
|
||||
category: string
|
||||
detail: string
|
||||
}
|
||||
|
||||
export interface PublicTrafficStats {
|
||||
generatedAt: string
|
||||
available: boolean
|
||||
@ -58,9 +65,22 @@ export interface PublicTrafficStats {
|
||||
totalRequests: number
|
||||
statusCounts: Record<TrafficStatusBucket, number>
|
||||
}>
|
||||
byPurpose: Array<{
|
||||
key: string
|
||||
label: string
|
||||
category: string
|
||||
detail: string
|
||||
responseBytes: number
|
||||
requestBytes: number | null
|
||||
requestBytesKnownCount: number
|
||||
totalRequests: number
|
||||
}>
|
||||
topPaths: Array<{
|
||||
path: string
|
||||
method: string
|
||||
purposeLabel: string
|
||||
purposeCategory: string
|
||||
purposeDetail: string
|
||||
responseBytes: number
|
||||
totalRequests: number
|
||||
}>
|
||||
@ -195,6 +215,303 @@ function parseNumber(value: unknown): number | null {
|
||||
return null
|
||||
}
|
||||
|
||||
function safeDecodePath(value: string): string {
|
||||
try {
|
||||
return decodeURIComponent(value)
|
||||
} catch {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
function isAssetPath(pathValue: string): boolean {
|
||||
return /\.(?:avif|webp|png|jpe?g|gif|svg|mp4|webm|mp3|wav|zip|rar|7z|pdf|psd|ai|cdr)$/i.test(pathValue)
|
||||
}
|
||||
|
||||
function assetTypeLabel(pathValue: string): string {
|
||||
if (/\.(?:avif|webp|png|jpe?g|gif|svg)$/i.test(pathValue)) return '图片直链访问'
|
||||
if (/\.(?:mp4|webm)$/i.test(pathValue)) return '视频直链访问'
|
||||
if (/\.(?:mp3|wav)$/i.test(pathValue)) return '音频直链访问'
|
||||
if (/\.(?:zip|rar|7z)$/i.test(pathValue)) return '压缩包直链访问'
|
||||
if (/\.(?:pdf|psd|ai|cdr)$/i.test(pathValue)) return '设计文件直链访问'
|
||||
return '资源文件直链访问'
|
||||
}
|
||||
|
||||
function fileNameFromPath(pathValue: string): string {
|
||||
const rawName = pathValue.split('/').filter(Boolean).pop() || pathValue
|
||||
return safeDecodePath(rawName)
|
||||
}
|
||||
|
||||
export function classifyPublicTrafficPurpose(domain: string, pathValue: string, method = 'GET'): PublicTrafficPurpose {
|
||||
const pathLower = pathValue.toLowerCase()
|
||||
const domainLower = domain.toLowerCase()
|
||||
const methodUpper = method.toUpperCase()
|
||||
|
||||
if (pathLower === '/api/materials/download') {
|
||||
return {
|
||||
key: 'material-download',
|
||||
label: '素材下载/打包下载',
|
||||
category: '素材库',
|
||||
detail: '用户下载素材原文件、压缩包或分享页下载时产生的流量。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower === '/api/external/download') {
|
||||
return {
|
||||
key: 'external-material-download',
|
||||
label: '外部平台素材下载',
|
||||
category: '外部接口',
|
||||
detail: '脉象、产品平台等外部系统通过下载 token 拉取素材文件。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/external/')) {
|
||||
return {
|
||||
key: 'external-api',
|
||||
label: '外部平台对接接口',
|
||||
category: '外部接口',
|
||||
detail: '外部系统查询素材、SPU、SKU、条码或图片信息。',
|
||||
}
|
||||
}
|
||||
|
||||
if (domainLower === 'cp.jiansun.vip') {
|
||||
if (pathLower === '/api/intake/non-integrated') {
|
||||
return {
|
||||
key: 'product-intake-non-integrated',
|
||||
label: '产品设计平台未集成素材列表',
|
||||
category: '产品设计平台',
|
||||
detail: '产品设计平台查看未集成素材或待处理录入内容。',
|
||||
}
|
||||
}
|
||||
if (pathLower === '/api/intake/product-patents') {
|
||||
return {
|
||||
key: 'product-intake-submit',
|
||||
label: '产品设计平台资料提交',
|
||||
category: '产品设计平台',
|
||||
detail: '产品设计平台提交产品图片、专利或录入资料。',
|
||||
}
|
||||
}
|
||||
if (pathLower === '/api/storage/object') {
|
||||
return {
|
||||
key: 'product-storage-object',
|
||||
label: '产品设计平台取图跳转',
|
||||
category: '产品设计平台',
|
||||
detail: '产品设计平台请求对象文件地址,通常后续由存储或 CDN 承接真实图片流量。',
|
||||
}
|
||||
}
|
||||
if (pathLower.startsWith('/api/intake/')) {
|
||||
return {
|
||||
key: 'product-intake-api',
|
||||
label: '产品设计平台录入接口',
|
||||
category: '产品设计平台',
|
||||
detail: '产品设计平台录入、查询或处理产品资料的接口请求。',
|
||||
}
|
||||
}
|
||||
if (pathLower.startsWith('/api/')) {
|
||||
return {
|
||||
key: 'product-platform-api',
|
||||
label: '产品设计平台业务接口',
|
||||
category: '产品设计平台',
|
||||
detail: '产品设计平台页面调用的业务接口。',
|
||||
}
|
||||
}
|
||||
return {
|
||||
key: 'product-platform-page',
|
||||
label: '产品设计平台页面访问',
|
||||
category: '产品设计平台',
|
||||
detail: '用户打开产品设计平台页面或加载前端静态资源。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/public-display/white-background/')) {
|
||||
return {
|
||||
key: 'white-background-preview',
|
||||
label: '标准模型白底图预览',
|
||||
category: '资源直链',
|
||||
detail: '白底图等标准模型展示图片从资源入口直接返回。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/public-display/task-detail/')) {
|
||||
return {
|
||||
key: 'task-detail-preview',
|
||||
label: '任务详情素材预览图',
|
||||
category: '资源直链',
|
||||
detail: '素材详情、主图、SKU 图、详情图等预览资源直链访问。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/public-display/materials/')) {
|
||||
return {
|
||||
key: 'material-preview',
|
||||
label: '素材预览图访问',
|
||||
category: '资源直链',
|
||||
detail: '素材库列表、详情或分享页展示预览图。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/uploads/direct/')) {
|
||||
return {
|
||||
key: 'direct-upload-asset',
|
||||
label: assetTypeLabel(pathValue),
|
||||
category: '直传资源',
|
||||
detail: `直传上传目录里的资源文件:${fileNameFromPath(pathValue)}`,
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/uploads/')) {
|
||||
return {
|
||||
key: 'legacy-upload-asset',
|
||||
label: assetTypeLabel(pathValue),
|
||||
category: '历史上传资源',
|
||||
detail: `历史上传目录里的资源文件:${fileNameFromPath(pathValue)}`,
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/product-package/')) {
|
||||
return {
|
||||
key: 'product-package-asset',
|
||||
label: '产品包资源访问',
|
||||
category: '资源直链',
|
||||
detail: '产品包、原始文件或成套资源通过资源入口直接访问。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/gongxiangpan/') || domainLower === 's3.jiansun.vip') {
|
||||
return {
|
||||
key: 'storage-asset',
|
||||
label: isAssetPath(pathValue) ? assetTypeLabel(pathValue) : '资源存储入口访问',
|
||||
category: '资源直链',
|
||||
detail: isAssetPath(pathValue)
|
||||
? `资源入口直接返回文件:${fileNameFromPath(pathValue)}`
|
||||
: '资源入口上的对象存储、探测或目录类请求。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/materials/upload/')) {
|
||||
return {
|
||||
key: 'material-upload',
|
||||
label: methodUpper === 'GET' ? '上传状态查询' : '素材上传接口',
|
||||
category: '素材库',
|
||||
detail: '素材上传分片、合并、刷新或上传状态相关请求。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower === '/api/materials') {
|
||||
return {
|
||||
key: 'material-list-search',
|
||||
label: '素材列表/搜索接口',
|
||||
category: '素材库',
|
||||
detail: '首页、素材列表或筛选搜索素材时加载的数据。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/materials/')) {
|
||||
return {
|
||||
key: 'material-detail-api',
|
||||
label: '素材详情/管理接口',
|
||||
category: '素材库',
|
||||
detail: '素材详情、SKU、资产排序、恢复、收藏、点赞等接口请求。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower === '/api/asset-center/substrates') {
|
||||
return {
|
||||
key: 'asset-center-substrates',
|
||||
label: '资产中心基底素材列表',
|
||||
category: '素材库',
|
||||
detail: '资产中心加载基底素材、贴图或可选素材列表。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/asset-center/')) {
|
||||
return {
|
||||
key: 'asset-center-api',
|
||||
label: '资产中心接口',
|
||||
category: '素材库',
|
||||
detail: '资产中心页面的数据查询或操作接口。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower === '/api/rankings') {
|
||||
return {
|
||||
key: 'home-ranking',
|
||||
label: '首页排行榜接口',
|
||||
category: '素材库',
|
||||
detail: '首页展示热门、排行或推荐素材数据。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/auth/') || pathLower.startsWith('/api/dingtalk/') || pathLower === '/dingtalk-callback') {
|
||||
return {
|
||||
key: 'login-auth',
|
||||
label: '登录/钉钉认证',
|
||||
category: '账号',
|
||||
detail: '登录状态、钉钉回调、会话检查等账号认证请求。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/performance-survey') || pathLower.startsWith('/performance-survey')) {
|
||||
return {
|
||||
key: 'performance-survey',
|
||||
label: '考核调研功能',
|
||||
category: '素材库',
|
||||
detail: '考核调研页面、列表、提交和结果查看相关请求。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/admin') || pathLower.startsWith('/api/admin/')) {
|
||||
return {
|
||||
key: 'admin-console',
|
||||
label: '后台管理功能',
|
||||
category: '后台',
|
||||
detail: '管理员后台页面和管理接口请求。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/share/')) {
|
||||
return {
|
||||
key: 'share-page',
|
||||
label: '素材分享页',
|
||||
category: '素材库',
|
||||
detail: '外部或内部用户打开素材分享页面。',
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/_next/') || pathLower === '/favicon.ico' || pathLower === '/api/favicon') {
|
||||
return {
|
||||
key: 'frontend-static',
|
||||
label: '前端静态资源',
|
||||
category: '页面加载',
|
||||
detail: '页面 JS、CSS、图标等前端基础资源。',
|
||||
}
|
||||
}
|
||||
|
||||
if (isAssetPath(pathValue)) {
|
||||
return {
|
||||
key: 'static-asset',
|
||||
label: assetTypeLabel(pathValue),
|
||||
category: '资源文件',
|
||||
detail: `直接访问的文件:${fileNameFromPath(pathValue)}`,
|
||||
}
|
||||
}
|
||||
|
||||
if (pathLower.startsWith('/api/')) {
|
||||
return {
|
||||
key: 'other-api',
|
||||
label: '其他业务接口',
|
||||
category: '其他',
|
||||
detail: '尚未细分到具体模块的接口请求。',
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
key: 'other-page',
|
||||
label: '其他页面访问',
|
||||
category: '其他',
|
||||
detail: '尚未细分到具体模块的页面或资源请求。',
|
||||
}
|
||||
}
|
||||
|
||||
function parseJsonLogLine(line: string, fallbackDomain: string): PublicTrafficLogEntry | null {
|
||||
try {
|
||||
const raw = JSON.parse(line) as Record<string, unknown>
|
||||
@ -326,12 +643,37 @@ function addEntry(stats: PublicTrafficStats, uniqueIps: Set<string>, entry: Publ
|
||||
domain.requestBytesKnownCount += 1
|
||||
}
|
||||
|
||||
const purpose = classifyPublicTrafficPurpose(entry.domain, entry.path, entry.method)
|
||||
let purposeStat = stats.byPurpose.find((item) => item.key === purpose.key)
|
||||
if (!purposeStat) {
|
||||
purposeStat = {
|
||||
key: purpose.key,
|
||||
label: purpose.label,
|
||||
category: purpose.category,
|
||||
detail: purpose.detail,
|
||||
responseBytes: 0,
|
||||
requestBytes: null,
|
||||
requestBytesKnownCount: 0,
|
||||
totalRequests: 0,
|
||||
}
|
||||
stats.byPurpose.push(purposeStat)
|
||||
}
|
||||
purposeStat.responseBytes += entry.responseBytes
|
||||
purposeStat.totalRequests += 1
|
||||
if (entry.requestBytes !== null) {
|
||||
purposeStat.requestBytes = (purposeStat.requestBytes || 0) + entry.requestBytes
|
||||
purposeStat.requestBytesKnownCount += 1
|
||||
}
|
||||
|
||||
const pathKey = `${entry.method} ${entry.path}`
|
||||
let topPath = stats.topPaths.find((item) => `${item.method} ${item.path}` === pathKey)
|
||||
if (!topPath) {
|
||||
topPath = {
|
||||
method: entry.method,
|
||||
path: entry.path,
|
||||
purposeLabel: purpose.label,
|
||||
purposeCategory: purpose.category,
|
||||
purposeDetail: purpose.detail,
|
||||
responseBytes: 0,
|
||||
totalRequests: 0,
|
||||
}
|
||||
@ -411,6 +753,7 @@ export async function getPublicTrafficStats(range: PublicTrafficRange): Promise<
|
||||
},
|
||||
byDay: [],
|
||||
byDomain: [],
|
||||
byPurpose: [],
|
||||
topPaths: [],
|
||||
source: {
|
||||
logPaths,
|
||||
@ -442,6 +785,7 @@ export async function getPublicTrafficStats(range: PublicTrafficRange): Promise<
|
||||
stats.source.requestBytesAvailable = stats.summary.requestBytesKnownCount > 0
|
||||
stats.byDay.sort((a, b) => a.date.localeCompare(b.date))
|
||||
stats.byDomain.sort((a, b) => b.responseBytes - a.responseBytes)
|
||||
stats.byPurpose.sort((a, b) => b.responseBytes - a.responseBytes)
|
||||
stats.topPaths.sort((a, b) => b.responseBytes - a.responseBytes)
|
||||
stats.topPaths = stats.topPaths.slice(0, 20)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user