-
-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathlib.rs
87 lines (79 loc) · 2.87 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* Parseable Server (C) 2022 - 2024 Parseable, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
pub mod about;
pub mod alerts;
pub mod analytics;
pub mod audit;
pub mod banner;
pub mod catalog;
mod cli;
#[cfg(feature = "kafka")]
pub mod connectors;
pub mod correlation;
pub mod enterprise;
mod event;
pub mod handlers;
pub mod hottier;
mod livetail;
mod metadata;
pub mod metrics;
pub mod migration;
mod oidc;
pub mod option;
pub mod otel;
pub mod parseable;
pub mod prism;
pub mod query;
pub mod rbac;
mod response;
mod static_schema;
mod stats;
pub mod storage;
pub mod sync;
pub mod users;
pub mod utils;
mod validator;
use std::time::Duration;
pub use handlers::http::modal::{
ingest_server::IngestServer, query_server::QueryServer, server::Server, ParseableServer,
};
use once_cell::sync::Lazy;
use reqwest::{Client, ClientBuilder};
// It is very unlikely that panic will occur when dealing with locks.
pub const LOCK_EXPECT: &str = "Thread shouldn't panic while holding a lock";
/// Describes the duration at the end of which in-memory buffers are flushed,
/// arrows files are "finished" and compacted into parquet files.
pub const LOCAL_SYNC_INTERVAL: Duration = Duration::from_secs(60);
/// Duration used to configure prefix generation.
pub const OBJECT_STORE_DATA_GRANULARITY: u32 = LOCAL_SYNC_INTERVAL.as_secs() as u32 / 60;
/// Describes the duration at the end of which parquets are pushed into objectstore.
pub const STORAGE_UPLOAD_INTERVAL: Duration = Duration::from_secs(30);
// A single HTTP client for all outgoing HTTP requests from the parseable server
static HTTP_CLIENT: Lazy<Client> = Lazy::new(|| {
ClientBuilder::new()
.connect_timeout(Duration::from_secs(3)) // set a timeout of 3s for each connection setup
.timeout(Duration::from_secs(30)) // set a timeout of 30s for each request
.pool_idle_timeout(Duration::from_secs(90)) // set a timeout of 90s for each idle connection
.pool_max_idle_per_host(32) // max 32 idle connections per host
.gzip(true) // gzip compress for all requests
.brotli(true) // brotli compress for all requests
.use_rustls_tls() // use only the rustls backend
.http1_only() // use only http/1.1
.build()
.expect("Construction of client shouldn't fail")
});