-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Synthetics endpoint to fetch uptimes in API spec #1984
Changes from all commits
4270d4b
f2cbb70
fec2861
beab1ed
9581251
75029d8
45e0402
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2024-10-02T14:22:00.562Z |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2024-09-11T13:09:28.349Z |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Fetch uptime for multiple tests returns "OK." response | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new | ||
|
||
body = DatadogAPIClient::V1::SyntheticsFetchUptimesPayload.new({ | ||
from_ts: 1726041488, | ||
public_ids: [ | ||
"p8m-9gw-nte", | ||
], | ||
to_ts: 1726055954, | ||
}) | ||
p api_instance.fetch_uptimes(body) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -756,6 +756,9 @@ | |
"v1.TriggerCITests" => { | ||
"body" => "SyntheticsCITestBody", | ||
}, | ||
"v1.FetchUptimes" => { | ||
"body" => "SyntheticsFetchUptimesPayload", | ||
}, | ||
Comment on lines
+759
to
+761
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ Code Quality ViolationConsider using symbols instead of string hash keys (...read more)In Ruby, it is a best practice to use symbols instead of strings as hash keys. This rule emphasizes that it's more efficient and idiomatic to use symbols for this purpose. Symbols are immutable and unique, which makes them ideal for identifying things, whereas strings are mutable and can create multiple objects for the same sequence of characters. The importance of this rule lies in the performance and memory usage of your Ruby application. Using symbols as hash keys reduces memory usage because they are stored in memory only once during a Ruby process. This can make a significant difference in the efficiency of your application, especially when dealing with large data sets. To ensure you're following good coding practices, always use symbols for hash keys unless there's a specific reason to use a string. A simple refactoring from |
||
"v1.GetTest" => { | ||
"public_id" => "String", | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Consider using the %W syntax instead (...read more)
The rule "Prefer
%w
to the literal array syntax" is a Ruby style guideline that encourages the use of%w
notation instead of the traditional array syntax when defining arrays of strings. This rule is part of the Ruby community's efforts to promote readability and simplicity in Ruby code.This rule is important because it helps to keep the code concise and easy to read. The
%w
notation allows you to define an array of strings without having to use quotes and commas. This can make the code cleaner and easier to understand, especially when dealing with large arrays.To follow this rule, replace the traditional array syntax with the
%w
notation. For example, instead of writing['foo', 'bar', 'baz']
, you should write%w[foo bar baz]
. This will create the same array, but in a more readable and concise way. By following this rule, you can help to make your Ruby code cleaner and easier to understand.