Class: Openlayer::Resources::Tests
- Inherits:
-
Object
- Object
- Openlayer::Resources::Tests
- Defined in:
- lib/openlayer/resources/tests.rb
Instance Method Summary collapse
-
#evaluate(test_id, end_timestamp:, start_timestamp:, inference_pipeline_id: nil, overwrite_results: nil, request_options: {}) ⇒ Openlayer::Models::TestEvaluateResponse
Some parameter documentations has been truncated, see Models::TestEvaluateParams for more details.
-
#initialize(client:) ⇒ Tests
constructor
private
A new instance of Tests.
-
#list_results(test_id, end_timestamp: nil, include_insights: nil, inference_pipeline_id: nil, page: nil, per_page: nil, project_version_id: nil, start_timestamp: nil, status: nil, request_options: {}) ⇒ Openlayer::Models::TestListResultsResponse
List the test results for a test.
Constructor Details
#initialize(client:) ⇒ Tests
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Tests.
91 92 93 |
# File 'lib/openlayer/resources/tests.rb', line 91 def initialize(client:) @client = client end |
Instance Method Details
#evaluate(test_id, end_timestamp:, start_timestamp:, inference_pipeline_id: nil, overwrite_results: nil, request_options: {}) ⇒ Openlayer::Models::TestEvaluateResponse
Some parameter documentations has been truncated, see Models::TestEvaluateParams for more details.
Triggers one-off evaluation of a specific monitoring test for a custom timestamp range. This allows evaluating tests for historical data or custom time periods outside the regular evaluation window schedule. It also allows overwriting the existing test results.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/openlayer/resources/tests.rb', line 31 def evaluate(test_id, params) parsed, = Openlayer::TestEvaluateParams.dump_request(params) @client.request( method: :post, path: ["tests/%1$s/evaluate", test_id], body: parsed, model: Openlayer::Models::TestEvaluateResponse, options: ) end |
#list_results(test_id, end_timestamp: nil, include_insights: nil, inference_pipeline_id: nil, page: nil, per_page: nil, project_version_id: nil, start_timestamp: nil, status: nil, request_options: {}) ⇒ Openlayer::Models::TestListResultsResponse
List the test results for a test.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/openlayer/resources/tests.rb', line 69 def list_results(test_id, params = {}) parsed, = Openlayer::TestListResultsParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["tests/%1$s/results", test_id], query: query.transform_keys( end_timestamp: "endTimestamp", include_insights: "includeInsights", inference_pipeline_id: "inferencePipelineId", per_page: "perPage", project_version_id: "projectVersionId", start_timestamp: "startTimestamp" ), model: Openlayer::Models::TestListResultsResponse, options: ) end |