query-profile.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*!
  2. * Copyright 2024 Google LLC. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import * as firestore from '@google-cloud/firestore';
  17. import { google } from '../protos/firestore_v1_proto_api';
  18. import { Serializer } from './serializer';
  19. import IPlanSummary = google.firestore.v1.IPlanSummary;
  20. import IExecutionStats = google.firestore.v1.IExecutionStats;
  21. import IExplainMetrics = google.firestore.v1.IExplainMetrics;
  22. /**
  23. * PlanSummary contains information about the planning stage of a query.
  24. *
  25. * @class PlanSummary
  26. */
  27. export declare class PlanSummary implements firestore.PlanSummary {
  28. readonly indexesUsed: Record<string, unknown>[];
  29. /**
  30. * @private
  31. * @internal
  32. */
  33. constructor(indexesUsed: Record<string, unknown>[]);
  34. /**
  35. * @private
  36. * @internal
  37. */
  38. static _fromProto(plan: IPlanSummary | null | undefined, serializer: Serializer): PlanSummary;
  39. }
  40. /**
  41. * ExecutionStats contains information about the execution of a query.
  42. *
  43. * @class ExecutionStats
  44. */
  45. export declare class ExecutionStats implements firestore.ExecutionStats {
  46. readonly resultsReturned: number;
  47. readonly executionDuration: firestore.Duration;
  48. readonly readOperations: number;
  49. readonly debugStats: Record<string, unknown>;
  50. /**
  51. * @private
  52. * @internal
  53. */
  54. constructor(resultsReturned: number, executionDuration: firestore.Duration, readOperations: number, debugStats: Record<string, unknown>);
  55. /**
  56. * @private
  57. * @internal
  58. */
  59. static _fromProto(stats: IExecutionStats | null | undefined, serializer: Serializer): ExecutionStats | null;
  60. }
  61. /**
  62. * ExplainMetrics contains information about planning and execution of a query.
  63. *
  64. * @class ExplainMetrics
  65. */
  66. export declare class ExplainMetrics implements firestore.ExplainMetrics {
  67. readonly planSummary: PlanSummary;
  68. readonly executionStats: ExecutionStats | null;
  69. /**
  70. * @private
  71. * @internal
  72. */
  73. constructor(planSummary: PlanSummary, executionStats: ExecutionStats | null);
  74. /**
  75. * @private
  76. * @internal
  77. */
  78. static _fromProto(metrics: IExplainMetrics, serializer: Serializer): ExplainMetrics;
  79. }
  80. /**
  81. * ExplainResults contains information about planning, execution, and results
  82. * of a query.
  83. *
  84. * @class ExplainResults
  85. */
  86. export declare class ExplainResults<T> implements firestore.ExplainResults<T> {
  87. readonly metrics: ExplainMetrics;
  88. readonly snapshot: T | null;
  89. /**
  90. * @private
  91. * @internal
  92. */
  93. constructor(metrics: ExplainMetrics, snapshot: T | null);
  94. }