Skip to content

Commit f2a1de7

Browse files
Add Vercel Monitor skeleton code. (#136)
1 parent b974c27 commit f2a1de7

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

src/adapters/monitors/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ pub trait Monitor: Shutdownable {
6060

6161
mod cloudflare;
6262
mod cloudwatch;
63+
mod vercel;

src/adapters/monitors/vercel.rs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#![allow(dead_code)]
2+
// This code won't be dead once we incorporate it into the flow.
3+
4+
use async_trait::async_trait;
5+
use derive_getters::Getters;
6+
7+
use crate::{
8+
Shutdownable, adapters::backend::MonitorConfig, metrics::ResponseStatusCode,
9+
stats::CategoricalObservation, subsystems::ShutdownResult,
10+
};
11+
use miette::Result;
12+
13+
use super::Monitor;
14+
15+
type VercelClient = ();
16+
17+
#[derive(Getters)]
18+
pub struct Vercel {
19+
client: VercelClient,
20+
}
21+
22+
impl Vercel {
23+
pub fn new(client: VercelClient) -> Self {
24+
Self { client }
25+
}
26+
}
27+
28+
#[async_trait]
29+
impl Monitor for Vercel {
30+
type Item = CategoricalObservation<5, ResponseStatusCode>;
31+
32+
fn get_config(&self) -> MonitorConfig {
33+
todo!();
34+
}
35+
36+
async fn query(&mut self) -> Result<Vec<Self::Item>> {
37+
todo!();
38+
}
39+
40+
async fn set_canary_version_id(&mut self, canary_version_id: String) -> Result<()> {
41+
let _ = canary_version_id;
42+
todo!();
43+
}
44+
45+
// TODO: standardize naming to baseline when working outside of statistics packages
46+
async fn set_baseline_version_id(&mut self, baseline_version_id: String) -> Result<()> {
47+
let _ = baseline_version_id;
48+
todo!();
49+
}
50+
}
51+
52+
#[async_trait]
53+
impl Shutdownable for Vercel {
54+
async fn shutdown(&mut self) -> ShutdownResult {
55+
todo!();
56+
}
57+
}

0 commit comments

Comments
 (0)