Skip to content

Commit

Permalink
Merge pull request #414 from nishantagarwal1990/na/add-timezone-param…
Browse files Browse the repository at this point in the history
…-#413

Support timezone param for WebSocketTransport execute
  • Loading branch information
breedx-splk authored Dec 15, 2023
2 parents 3cf4e64 + 06ee60b commit af0910e
Showing 1 changed file with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Computation execute(String program) {

/**
* This method is deprecated and will be removed in the next major release. Use
* {@link #execute(String, Long, Long, Long, Long, Boolean, Boolean)} instead
* {@link #execute(String, Long, Long, Long, Long, Boolean, Boolean, String)} instead
*
* Execute the given SignalFlow program with parameters and stream the output back.
*
Expand All @@ -77,11 +77,12 @@ public Computation execute(String program) {
@Deprecated
public Computation execute(String program, long start, long stop, long resolution,
long maxDelay, boolean persistent) {
return execute(program, start, stop, resolution, maxDelay, persistent, false);
return execute(program, start, stop, resolution, maxDelay, persistent, false, null);
}

/**
* Execute the given SignalFlow program with parameters and stream the output back.
* This method is deprecated and will be removed in the next major release. Use
* {@link #execute(String, Long, Long, Long, Long, Boolean, Boolean, String)} instead
*
* @param program
* computation written in signalflow language
Expand All @@ -104,10 +105,43 @@ public Computation execute(String program, long start, long stop, long resolutio
* future data to be available
* @return computation instance
*/
@Deprecated
public Computation execute(String program, Long start, Long stop, Long resolution,
Long maxDelay, Boolean persistent, Boolean immediate) {
return execute(program, start, stop, resolution, maxDelay, persistent, immediate, null);
}

/**
* Execute the given SignalFlow program with parameters and stream the output back.
*
* @param program
* computation written in signalflow language
* @param start
* Optional timestamp in milliseconds since epoch. Defaults to the current timestamp.
* @param stop
* Optional timestamp in milliseconds since epoch. Defaults to infinity.
* @param resolution
* Optional the minimum desired data resolution, in milliseconds. This allows the
* client to put an upper bound on the number of datapoints in the computation
* output.
* @param maxDelay
* Optional desired maximum data delay, in milliseconds between 1 and 900000. When
* set to zero or unset, max delay will be evaluated dynamically based on the
* historical lag information of the input data.
* @param persistent
* Optional persistent setting
* @param immediate
* Optional adjusts the stop timestamp so that the computation doesn't wait for
* future data to be available
* @param timeZone
* Optional the time zone to be used for computation. The value is forwarded to the endpoint.
* Supported time zone values are mentioned in the <a href="https://dev.splunk.com/observability/docs/time_zone">docs.</a>
* @return computation instance
*/
public Computation execute(String program, Long start, Long stop, Long resolution,
Long maxDelay, Boolean persistent, Boolean immediate, String timeZone) {
Map<String, String> params = buildParams("start", start, "stop", stop, "resolution",
resolution, "maxDelay", maxDelay, "persistent", persistent, "immediate", immediate);
resolution, "maxDelay", maxDelay, "persistent", persistent, "immediate", immediate, "timezone", timeZone);
return new Computation(this.transport, program, params, false);
}

Expand Down

0 comments on commit af0910e

Please sign in to comment.