source-statistics-view.td 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ set-arg-default single-replica-cluster=quickstart
  10. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  11. ALTER SYSTEM SET storage_statistics_collection_interval = 1000
  12. ALTER SYSTEM SET storage_statistics_interval = 2000
  13. > CREATE SOURCE counter
  14. IN CLUSTER ${arg.single-replica-cluster}
  15. FROM LOAD GENERATOR COUNTER (UP TO 100);
  16. > SELECT
  17. s.name,
  18. -- Counters
  19. u.messages_received > 0,
  20. u.bytes_received > 0,
  21. u.updates_staged > 0,
  22. u.updates_committed > 0,
  23. -- Resetting Gauges
  24. u.records_indexed = 0,
  25. u.bytes_indexed = 0,
  26. u.rehydration_latency IS NOT NULL,
  27. u.snapshot_records_known IS NULL,
  28. u.snapshot_records_staged IS NULL,
  29. u.snapshot_committed,
  30. -- Gauges
  31. u.offset_known > 0,
  32. u.offset_committed > 0
  33. FROM mz_sources s
  34. JOIN mz_internal.mz_source_statistics_raw u ON s.id = u.id
  35. WHERE s.name IN ('counter')
  36. counter true true true true true true true true true true true true
  37. > DROP SOURCE counter CASCADE