Artifactspublic-v0

curl

master
ply4 git calls25 ms289 KiB3 cachedprotocol v2
205 lines4.9 KiBRaw
1/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.se/docs/copyright.html.
13 *
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 * SPDX-License-Identifier: curl
22 *
23 ***************************************************************************/
24#include "first.h"
26#ifdef HAVE_THREADS_POSIX
28#define CONN_NUM 3
29#define TIME_BETWEEN_START_SECS 2
31static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
32static CURL *pending_curls[CONN_NUM];
33static int pending_num = 0;
34static CURLcode t1565_test_failure = CURLE_OK;
36static CURLM *testmulti = NULL;
37static const char *t1565_url;
39static void *t1565_run_thread(void *ptr)
41 CURL *curl = NULL;
42 CURLcode result = CURLE_OK;
43 int i;
45 (void)ptr;
47 for(i = 0; i < CONN_NUM; i++) {
48 curlx_wait_ms(TIME_BETWEEN_START_SECS * 1000);
50 easy_init(curl);
52 easy_setopt(curl, CURLOPT_URL, t1565_url);
53 easy_setopt(curl, CURLOPT_VERBOSE, 0L);
55 pthread_mutex_lock(&lock);
57 if(t1565_test_failure) {
58 pthread_mutex_unlock(&lock);
59 goto test_cleanup;
60 }
62 pending_curls[pending_num] = curl;
63 pending_num++;
64 curl = NULL;
66 pthread_mutex_unlock(&lock);
68 res_multi_wakeup(testmulti);
69 }
71test_cleanup:
73 curl_easy_cleanup(curl);
75 pthread_mutex_lock(&lock);
77 if(!t1565_test_failure)
78 t1565_test_failure = result;
80 pthread_mutex_unlock(&lock);
82 return NULL;
85static CURLcode test_lib1565(const char *URL)
87 int still_running;
88 int num;
89 int i;
90 int rc;
91 CURLcode result = CURLE_OK;
92 CURL *started_curls[CONN_NUM];
93 int started_num = 0;
94 int finished_num = 0;
95 pthread_t tid = 0;
96 bool tid_valid = FALSE;
97 struct CURLMsg *message;
99 start_test_timing();
101 global_init(CURL_GLOBAL_ALL);
103 multi_init(testmulti);
105 t1565_url = URL;
107 rc = pthread_create(&tid, NULL, t1565_run_thread, NULL);
108 if(!rc)
109 tid_valid = TRUE;
110 else {
111 curl_mfprintf(stderr, "%s:%d Could not create thread, errno %d\n",
112 __FILE__, __LINE__, rc);
113 result = CURLE_FAILED_INIT;
114 goto test_cleanup;
115 }
117 while(1) {
118 multi_perform(testmulti, &still_running);
120 abort_on_test_timeout();
122 while((message = curl_multi_info_read(testmulti, &num))) {
123 if(message->msg == CURLMSG_DONE) {
124 result = message->data.result;
125 if(result)
126 goto test_cleanup;
127 multi_remove_handle(testmulti, message->easy_handle);
128 finished_num++;
129 }
130 else {
131 curl_mfprintf(stderr,
132 "%s:%d Got an unexpected message from curl: %d\n",
133 __FILE__, __LINE__, (int)message->msg);
134 result = TEST_ERR_MAJOR_BAD;
135 goto test_cleanup;
136 }
138 abort_on_test_timeout();
139 }
141 if(CONN_NUM == finished_num)
142 break;
144 multi_poll(testmulti, NULL, 0, TEST_HANG_TIMEOUT, &num);
146 abort_on_test_timeout();
148 pthread_mutex_lock(&lock);
150 while(pending_num > 0) {
151 res_multi_add_handle(testmulti, pending_curls[pending_num - 1]);
152 if(result) {
153 pthread_mutex_unlock(&lock);
154 goto test_cleanup;
155 }
157 started_curls[started_num] = pending_curls[pending_num - 1];
158 started_num++;
159 pending_num--;
160 }
162 pthread_mutex_unlock(&lock);
164 abort_on_test_timeout();
165 }
167 if(CONN_NUM != started_num) {
168 curl_mfprintf(stderr, "%s:%d Not all connections started: %d of %d\n",
169 __FILE__, __LINE__, started_num, CONN_NUM);
170 goto test_cleanup;
171 }
173 if(CONN_NUM != finished_num) {
174 curl_mfprintf(stderr, "%s:%d Not all connections finished: %d of %d\n",
175 __FILE__, __LINE__, started_num, CONN_NUM);
176 goto test_cleanup;
177 }
179test_cleanup:
181 pthread_mutex_lock(&lock);
182 if(!t1565_test_failure)
183 t1565_test_failure = result;
184 pthread_mutex_unlock(&lock);
186 if(tid_valid)
187 pthread_join(tid, NULL);
189 curl_multi_cleanup(testmulti);
190 for(i = 0; i < pending_num; i++)
191 curl_easy_cleanup(pending_curls[i]);
192 for(i = 0; i < started_num; i++)
193 curl_easy_cleanup(started_curls[i]);
194 curl_global_cleanup();
196 return t1565_test_failure;
199#else /* without pthread, this test does not work */
200static CURLcode test_lib1565(const char *URL)
202 (void)URL;
203 return CURLE_OK;
205#endif
Diagnostics4 git calls · 25 ms
CallStatusSizeTime025 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=18
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.8 KiB · hit19 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1872
git.response.cache=HIT
git.response.duration_ms=19
git.fetch.wants=825d88e2ed4d9b3df3540dad3b0d58cc4ef41aa6
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1872
git.pkt.payload.max=1851
git.sideband.band1.bytes=1850
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e32d30a8f78821
Request
ed104e5e…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format