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

WIP/Idea: Streaming: add common request options #18728

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/grafana-ui/src/types/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ export interface DataStreamState {
*/
data?: DataFrame[];

/**
* True when the data represents changes since the last event rather
* than an entire DataFrame result
*/
isDelta?: boolean;

/**
* Error in stream (but may still be running)
*/
Expand Down Expand Up @@ -437,6 +443,20 @@ export interface ScopedVars {
[key: string]: ScopedVar;
}

export interface StreamingQueryOptions {
/**
* Request an explicit buffer size. When not specified, this will
* default to `request.maxDataPoints`
*/
buffer?: number;

/**
* Ask the DataSource to send only changes since the last notification
* rather than full buffered DataFrames
*/
isDelta?: boolean;
}

export interface DataQueryRequest<TQuery extends DataQuery = DataQuery> {
requestId: string; // Used to identify results and optionally cancel the request in backendSrv
timezone: string;
Expand All @@ -451,6 +471,7 @@ export interface DataQueryRequest<TQuery extends DataQuery = DataQuery> {
intervalMs: number;
maxDataPoints: number;
scopedVars: ScopedVars;
stream?: StreamingQueryOptions;

// Request Timing
startTime: number;
Expand Down