@@ -568,3 +568,114 @@ following behavior:
568568 {
569569 "ok": true
570570 }
571+
572+ .. _api/db/time_seq :
573+
574+ =====================
575+ ``/{db}/_time_seq ``
576+ =====================
577+
578+ .. http :get :: /{db}/_time_seq
579+ :synopsis: Get the time-seq data structure summaries
580+
581+ Time-seq is a data structure which keeps track of how db sequences map to
582+ rough time intervals. Each summary contains all the interval start times
583+ and the number of sequences in that time interval.
584+
585+ :param db: Database name
586+ :<header Accept: - :mimetype: `application/json `
587+ - :mimetype: `text/plain `
588+ :>header Content-Type: - :mimetype: `application/json `
589+ - :mimetype: `text/plain; charset=utf-8 `
590+ :>json object time_seq: A time_seq summaries broken down by range and node.
591+ :code 200: Request completed successfully
592+ :code 400: Invalid database name
593+ :code 401: Read privilege required
594+ :code 403: Insufficient permissions / :ref: `Too many requests with invalid credentials<error/403> `
595+ :code 415: Bad :header: `Content-Type ` value
596+ :code 500: Internal server error or timeout
597+
598+ **Request **:
599+
600+ .. code-block :: http
601+
602+ GET /db/_time_seq HTTP/1.1
603+ Accept: application/json
604+ Host: localhost:5984
605+
606+ **Response **:
607+
608+ .. code-block :: http
609+
610+ HTTP/1.1 200 OK
611+ Cache-Control: must-revalidate
612+ Content-Length: 400
613+ Content-Type: application/json
614+
615+ {
616+ "time_seq": {
617+ "00000000-7fffffff": {
618+ 619+ ["2025-07-27T06:00:00Z", 8],
620+ ["2025-07-27T09:00:00Z", 13],
621+ ["2025-07-27T12:00:00Z", 13],
622+ ["2025-07-27T15:00:00Z", 7],
623+ ["2025-07-27T18:00:00Z", 3]
624+ ]
625+ },
626+ "80000000-ffffffff": {
627+ 628+ ["2025-07-27T03:00:00Z", 1],
629+ ["2025-07-27T06:00:00Z", 10],
630+ ["2025-07-27T09:00:00Z", 5],
631+ ["2025-07-27T12:00:00Z", 5],
632+ ["2025-07-27T15:00:00Z", 11],
633+ ["2025-07-27T18:00:00Z", 2]
634+ ]
635+ }
636+ }
637+ }
638+
639+ .. http :delete :: /{db}/_time_seq
640+ :synopsis: Reset time-seq data structures.
641+
642+ Time-seq is a data structure which keeps track of how db sequences map to
643+ rough time intervals. The ``DELETE `` method will reset time-seq data
644+ structure for all the shards in the database. Resetting the time-seq
645+ structure is always safe and doesn't alter the main b-trees, document
646+ revisions, or document bodies. It just resets the time to database
647+ sequences mappings. This should be rarely needed and is mainly to be used
648+ perhaps in the case when the OS time settings were misconfigured and the
649+ the time-seq data structures recorded invalid dates from a distant future.
650+
651+ :param db: Database name
652+ :<header Accept: - :mimetype: `application/json `
653+ - :mimetype: `text/plain `
654+ :<header Content-Type: :mimetype: `application/json `
655+ :>header Content-Type: - :mimetype: `application/json `
656+ - :mimetype: `text/plain; charset=utf-8 `
657+ :>json boolean ok: Operation status
658+ :code 200: Request completed successfully
659+ :code 400: Invalid JSON data
660+ :code 401: Unauthorized request to a protected API
661+ :code 403: Insufficient permissions / :ref: `Too many requests with invalid credentials<error/403> `
662+
663+ **Request **:
664+
665+ .. code-block :: http
666+
667+ DELETE /db/_time_seq HTTP/1.1
668+ Content-Length: 0
669+ Host: localhost:15984
670+
671+ **Response **:
672+
673+ .. code-block :: http
674+
675+ HTTP/1.1 200 OK
676+ Content-Length: 12
677+ Content-Type: application/json
678+
679+ {
680+ "ok": true
681+ }
0 commit comments