Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

add show_time_lag to subscription stats function #200

Merged
merged 6 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
nakadi:
image: docker.pkg.github.com/adyach/nakadi-docker/nakadi:latest
image: adyach/nakadi-docker:3.3.8
ports:
- "8080:8080"
depends_on:
Expand Down
7 changes: 6 additions & 1 deletion src/main/scala/org/zalando/kanadi/api/Subscriptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1625,12 +1625,17 @@ case class Subscriptions(baseUri: URI, oAuth2TokenProvider: Option[OAuth2TokenPr
* operational troubleshooting and log analysis.
* @return
*/
def stats(subscriptionId: SubscriptionId)(implicit
def stats(subscriptionId: SubscriptionId, showTimeLag: Boolean = false)(implicit
flowId: FlowId = randomFlowId(),
executionContext: ExecutionContext
): Future[Option[SubscriptionStats]] = {
val showTimeLagQuery: Query = if (showTimeLag) {
Query("show_time_lag" -> showTimeLag.toString)
} else Query.Empty

val uri = baseUri_
.withPath(baseUri_.path / "subscriptions" / subscriptionId.id.toString / "stats")
.withQuery(showTimeLagQuery)

for {
headers <- oAuth2TokenProvider match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ trait SubscriptionsInterface {

def closeHttpConnection(subscriptionId: SubscriptionId, streamId: StreamId): Boolean

def stats(subscriptionId: SubscriptionId)(implicit
def stats(subscriptionId: SubscriptionId, showTimeLag: Boolean = false)(implicit
flowId: FlowId = randomFlowId(),
executionContext: ExecutionContext
): Future[Option[SubscriptionStats]]
Expand Down