gpt4 book ai didi

ios - 如何阅读 URLSessionTaskMetrics?

转载 作者:行者123 更新时间:2023-12-01 16:08:41 26 4
gpt4 key购买 nike

我收集有关请求的指标,我看到以下信息:

(Task Interval) <_NSConcreteDateInterval: 0x60800022d6e0> (Start Date) 2017-05-26 15:04:14 +0000 + (Duration) 4.643568 seconds = (End Date) 2017-05-26 15:04:19 +0000
(Redirect Count) 0
(Transaction Metrics) (Request) <NSURLRequest: 0x608000016b80> { URL: <URL> }
(Response) <NSHTTPURLResponse: 0x60800043ad00> { URL: <URL> } { status code: 200, headers { <headers> }
(Fetch Start) 2017-05-26 15:04:14 +0000
(Domain Lookup Start) (null)
(Domain Lookup End) (null)
(Connect Start) (null)
(Secure Connection Start) (null)
(Secure Connection End) (null)
(Connect End) (null)
(Request Start) 2017-05-26 15:04:14 +0000
(Request End) 2017-05-26 15:04:14 +0000
(Response Start) 2017-05-26 15:04:18 +0000
(Response End) 2017-05-26 15:04:19 +0000
(Protocol Name) h2
(Proxy Connection) NO
(Reused Connection) YES
(Fetch Type) Network Load

这里让我感到困惑的是以下几行:
(Request End) 2017-05-26 15:04:14 +0000
(Response Start) 2017-05-26 15:04:18 +0000

某事发生了四秒钟,我不明白到底是什么。

同时ab(Apache Benchmark)显示如下数字:
Requests per second:    1.59 [#/sec] (mean)
Time per request: 629.910 [ms] (mean)
Time per request: 629.910 [ms] (mean, across all concurrent requests)
Transfer rate: 121.60 [Kbytes/sec] received

有没有人知道那里可能出现什么问题?如何提高响应时间?

最佳答案

请求结束和响应开始之间的时间是 http header 传输和服务器准备响应以发送给您的时间。我的猜测是你应该检查你的 GET。
下图很好地解释了指标和时间线:
enter image description here

关于ios - 如何阅读 URLSessionTaskMetrics?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44205928/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com