Skip to content

Conversation

@Gabriel39
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@Gabriel39
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

// belongs to exec_env, for all query, if enabled
class PipelineTracerContext {
public:
PipelineTracerContext() : _data(std::make_shared<QueryTracesMap>()) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]

Suggested change
PipelineTracerContext() : _data(std::make_shared<QueryTracesMap>()) {}
PipelineTracerContext() : _data(std::make_shared<QueryTracesMap>()) = default;

def to_json(self) :
json = {"name": self.task_name, "cat": self.state_name, "ph": "X", "ts": self.start_time, "dur": self.end_time - self.start_time,
json = {"name": self.task_name, "ph": "X", "ts": self.start_time, "dur": self.end_time - self.start_time,
"pid": self.get_core(), "tid": self.thread_id}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "args": {"tags": self.query_id} to find same query

@Gabriel39
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.88% (9123/25423)
Line Coverage: 27.36% (74949/273939)
Region Coverage: 26.60% (38804/145891)
Branch Coverage: 23.44% (19750/84252)
Coverage Report: http://coverage.selectdb-in.cc/coverage/97ea6eac4aa37bd7da4ddab919fbd25b127e2aca_97ea6eac4aa37bd7da4ddab919fbd25b127e2aca/report/index.html

@doris-robot
Copy link

TPC-H: Total hot run time: 41147 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 97ea6eac4aa37bd7da4ddab919fbd25b127e2aca, data reload: false

------ Round 1 ----------------------------------
q1	17590	4296	4245	4245
q2	2014	195	204	195
q3	10442	1256	1263	1256
q4	10193	831	780	780
q5	7486	2726	2729	2726
q6	222	135	131	131
q7	958	602	611	602
q8	9226	2105	2097	2097
q9	9612	6714	6712	6712
q10	10039	3918	3868	3868
q11	432	249	243	243
q12	497	229	220	220
q13	17510	3230	3201	3201
q14	253	205	220	205
q15	505	497	474	474
q16	533	398	396	396
q17	966	624	687	624
q18	8329	7754	7832	7754
q19	4468	1563	1540	1540
q20	647	319	300	300
q21	5195	3946	3299	3299
q22	341	279	280	279
Total cold run time: 117458 ms
Total hot run time: 41147 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4599	4424	4366	4366
q2	385	286	275	275
q3	3160	2901	2899	2899
q4	1890	1628	1608	1608
q5	5458	5506	5487	5487
q6	213	123	125	123
q7	2208	1870	1796	1796
q8	3250	3397	3382	3382
q9	8618	8712	8615	8615
q10	3951	3678	3802	3678
q11	625	489	516	489
q12	787	642	635	635
q13	16239	3157	3120	3120
q14	323	272	288	272
q15	536	486	495	486
q16	481	432	445	432
q17	1859	1493	1491	1491
q18	7625	7501	7447	7447
q19	1657	1542	1575	1542
q20	2031	1816	1811	1811
q21	11920	4777	4750	4750
q22	579	484	492	484
Total cold run time: 78394 ms
Total hot run time: 55188 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 168823 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 97ea6eac4aa37bd7da4ddab919fbd25b127e2aca, data reload: false

query1	927	379	375	375
query2	7746	2372	2254	2254
query3	6637	206	207	206
query4	19622	17392	17547	17392
query5	4152	416	416	416
query6	258	157	149	149
query7	4606	298	288	288
query8	239	188	180	180
query9	8564	2385	2375	2375
query10	450	284	255	255
query11	10527	10078	10086	10078
query12	130	89	84	84
query13	1638	372	371	371
query14	9514	6698	6846	6698
query15	218	164	168	164
query16	7255	268	265	265
query17	1316	511	500	500
query18	1873	272	268	268
query19	200	149	149	149
query20	92	90	87	87
query21	200	131	131	131
query22	4240	4025	4237	4025
query23	33636	32997	33057	32997
query24	7036	2826	2908	2826
query25	545	349	353	349
query26	703	154	156	154
query27	1957	316	316	316
query28	3760	2089	2084	2084
query29	862	602	590	590
query30	229	153	151	151
query31	987	745	733	733
query32	95	54	54	54
query33	501	269	258	258
query34	856	469	468	468
query35	703	600	608	600
query36	1013	914	876	876
query37	98	68	64	64
query38	2875	2773	2748	2748
query39	839	792	788	788
query40	197	128	122	122
query41	47	44	45	44
query42	104	96	127	96
query43	611	538	558	538
query44	1040	746	749	746
query45	177	163	160	160
query46	1066	739	737	737
query47	1870	1808	1817	1808
query48	364	291	300	291
query49	764	378	379	378
query50	775	399	372	372
query51	6689	6686	6677	6677
query52	111	87	90	87
query53	355	288	283	283
query54	530	458	420	420
query55	73	72	71	71
query56	255	237	248	237
query57	1150	1049	1038	1038
query58	225	217	233	217
query59	3373	3278	2988	2988
query60	279	253	258	253
query61	86	86	83	83
query62	560	454	455	454
query63	314	283	282	282
query64	8461	2210	1693	1693
query65	3195	3110	3102	3102
query66	929	344	330	330
query67	15322	14742	14769	14742
query68	5524	550	554	550
query69	500	267	275	267
query70	1169	1065	1146	1065
query71	477	265	267	265
query72	8427	5726	2699	2699
query73	761	322	319	319
query74	5932	5703	5558	5558
query75	3727	2652	2628	2628
query76	3336	951	1005	951
query77	576	262	265	262
query78	10291	9781	9685	9685
query79	2550	528	529	528
query80	1019	446	425	425
query81	464	220	222	220
query82	809	93	90	90
query83	192	168	187	168
query84	268	88	88	88
query85	907	262	257	257
query86	446	299	304	299
query87	3285	3112	3147	3112
query88	4353	2358	2403	2358
query89	461	386	378	378
query90	2203	182	186	182
query91	120	98	94	94
query92	58	48	50	48
query93	3819	536	507	507
query94	1084	186	187	186
query95	395	310	304	304
query96	604	267	266	266
query97	3227	3002	2990	2990
query98	246	218	217	217
query99	1156	860	842	842
Total cold run time: 264407 ms
Total hot run time: 168823 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.44 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 97ea6eac4aa37bd7da4ddab919fbd25b127e2aca, data reload: false

query1	0.04	0.04	0.04
query2	0.07	0.04	0.04
query3	0.22	0.05	0.06
query4	1.68	0.09	0.09
query5	0.50	0.47	0.50
query6	1.12	0.72	0.73
query7	0.02	0.02	0.01
query8	0.05	0.05	0.04
query9	0.54	0.47	0.49
query10	0.54	0.55	0.55
query11	0.15	0.12	0.11
query12	0.15	0.11	0.11
query13	0.60	0.59	0.61
query14	0.80	0.77	0.78
query15	0.84	0.80	0.82
query16	0.37	0.37	0.36
query17	0.98	0.98	1.05
query18	0.21	0.24	0.24
query19	1.72	1.69	1.70
query20	0.02	0.01	0.01
query21	15.41	0.70	0.69
query22	4.39	7.03	1.74
query23	18.32	1.39	1.27
query24	1.77	0.29	0.20
query25	0.16	0.09	0.09
query26	0.26	0.17	0.17
query27	0.08	0.08	0.08
query28	13.34	1.01	0.99
query29	12.67	3.40	3.31
query30	0.24	0.06	0.05
query31	2.90	0.38	0.38
query32	3.27	0.46	0.46
query33	2.84	2.96	2.92
query34	17.14	4.41	4.45
query35	4.48	4.50	4.53
query36	0.68	0.48	0.46
query37	0.18	0.14	0.15
query38	0.15	0.15	0.15
query39	0.04	0.03	0.03
query40	0.15	0.15	0.15
query41	0.09	0.05	0.04
query42	0.05	0.04	0.04
query43	0.04	0.03	0.03
Total cold run time: 109.27 s
Total hot run time: 30.44 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label May 29, 2024
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

}

void PipelineTracerContext::_update(std::function<void(QueryTracesMap&)>&& handler) {
auto map_ptr = std::atomic_load_explicit(&_data, std::memory_order_relaxed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use these atomic APIs for std::shared_ptr. they are deprecated in C++20 and will be removed in C++26. use std::atomic<shared_ptr> instead.


ScheduleRecord record;
while (_datas[query_id].try_dequeue(record)) {
while ((*map_ptr)[QueryID {query_id}]->try_dequeue(record)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe here we should add some comment to let people know it's thread-safe by copy-and-swap for any possible modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants