Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(volo-http): adjust stats of client and server #396

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

wfly1998
Copy link
Member

@wfly1998 wfly1998 commented Apr 1, 2024

Motivation

We note that process_start, process_end and method, uri, status_code are common information, it is best to put them in CommonStats. And only the client needs to log transport times, so this can be put in ClientStats.

Solution

 pub struct CommonStats {
+    process_start_at: Option<DateTime<Local>>,
+    process_end_at: Option<DateTime<Local>>,
+
+    method: Option<Method>,
+    uri: Option<Uri>,
+    status_code: Option<StatusCode>,
+
     req_size: Option<u64>,
     resp_size: Option<u64>,
-    status_code: Option<StatusCode>,
 }

+pub struct ServerStats {}
-pub struct ServerStats {
-    process_start_at: Option<DateTime<Local>>,
-    process_end_at: Option<DateTime<Local>>,
-
-    method: Option<Method>,
-    uri: Option<Uri>,
-}

 pub struct ClientStats {
     transport_start_at: Option<DateTime<Local>>,
     transport_end_at: Option<DateTime<Local>>,
-
-    status_code: Option<StatusCode>,
 }

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
@wfly1998 wfly1998 requested review from a team as code owners April 1, 2024 08:24
@wfly1998 wfly1998 merged commit 0c56306 into cloudwego:main Apr 1, 2024
13 checks passed
@wfly1998 wfly1998 deleted the chore/http-process-stat branch April 1, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants