Skip to content
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

Datasets #128

Merged
merged 45 commits into from
Nov 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
415c417
Add SnakeCaseContractResolved for deserializing responses to CLR types
Jul 26, 2017
6b553e1
Add Datasets and relevant models
Jul 26, 2017
9e59776
Add a query definition model
Jul 26, 2017
4fc9a8b
Add functions in KeenClient to query Datasets and their definitions
Jul 26, 2017
5b9643f
Add unit test for QueryDatasetAsync
Jul 26, 2017
6f3a5b4
Merge remote-tracking branch 'keenlabs/master' into cached-datasets
Jul 26, 2017
fec9c16
Fix typo on private field: _cachedDatasetRelativeUrl
Aug 11, 2017
7c98001
Provide XML comments for all new public facing methods
Aug 11, 2017
4a5b56f
Provide XML comments for the dataset classes exposed via KeenClient
Aug 11, 2017
0394b1d
Move IDataset into it's own file
Aug 11, 2017
fd294c4
Clean up scope of using statements
Aug 11, 2017
e0a6ebb
Fix scope of SnakeCasecontractResolver
Aug 11, 2017
ac0e91f
Rename Dataset.cs and provide serialization and validation utility
Aug 17, 2017
6f5b3ec
Clean up usings
Aug 17, 2017
0ed3fb2
Added class for fetching lists of dataset definitions
Aug 17, 2017
c39aa24
Added Validation and Serialization utility for QueryDefinition
Aug 17, 2017
d6425ca
Added Put methods to KeenHttpClient
Aug 17, 2017
dae4202
Implement Create, Delete and Get All for Cached Datasets
Aug 17, 2017
4b42fce
Added sync methods for Create, Delete and List Cached Datasets
Aug 17, 2017
891b1ae
Add XML comments to public facing methods
Aug 17, 2017
c2602e9
Remove models which are not used
Aug 17, 2017
5c2c2ac
Fix minor typo in DeleteDataset
Aug 17, 2017
3fcb789
Add some simple tests for the new dataset methods
Aug 17, 2017
7b98a80
Update dataset tests to test sync methods instead of async ones
Aug 17, 2017
306cdaa
Use shared GetSerializerSettings function for getdatasetdefinition
Aug 17, 2017
2e69245
Add testing for the custom serialization logic
Aug 17, 2017
16e3fc8
Added teast for serializing datasetdefinitioncollection
Aug 17, 2017
883f1eb
Merge branch 'master' into cached-datasets
Aug 17, 2017
ff25092
Fix bug with ListDatasetDefinition that popped up in unit tests
Aug 18, 2017
7674dc4
Include testing for Create and Delete datasets
Aug 21, 2017
f90189c
Add tests for dataset error modes
Aug 21, 2017
16b6f51
Clean up scope of imports
Aug 21, 2017
7c3c8ef
Merge remote-tracking branch 'github/master' into jm_UpdateCachedData…
masojus Oct 26, 2017
b9d6f59
Minor formatting/style changes.
masojus Nov 4, 2017
2f68d98
No need for a `SnakeCaseContractResolver` since Json.NET has a `Snake…
masojus Nov 4, 2017
ed82ebb
More PR Feedback--no need to use these custom converters:
masojus Nov 4, 2017
f9906fc
More PR feedback:
masojus Nov 4, 2017
a1e13a1
Swap the contents of `DatasetTests` and `DataSetTests_Integration` an…
masojus Nov 4, 2017
bb4aab9
Rename methods to `*Async()` since they return `Task`s.
masojus Nov 4, 2017
7379005
Filling out some interface XML doc comments.
masojus Nov 4, 2017
74d10c3
Port Datasets to NetStandard:
masojus Nov 4, 2017
81e3f4d
This should make tests be able to load those JSON files from a local …
masojus Nov 4, 2017
9638f01
Merge branch 'master' into jm_UpdateCachedDatasetsBranch
masojus Nov 10, 2017
747b9c7
Responding to some PR Feedback:
masojus Nov 11, 2017
f73aa1d
In response to PR feedback, escape some of the URL query string param…
masojus Nov 11, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Keen.NET.Test/ApiResponses/GetDatasetDefinition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"dataset_name": "count-purchases-gte-100-by-country-daily",
"display_name": "Count Daily Product Purchases Over $100 by Country",
"query": {
"project_id": "5011efa95f546f2ce2000000",
"analysis_type": "count",
"event_collection": "purchases",
"filters": [
{
"property_name": "price",
"operator": "gte",
"property_value": 100
}
],
"timeframe": "this_500_days",
"interval": "daily",
"group_by": [ "ip_geo_info.country" ]
},
"index_by": [ "product.id" ],
"last_scheduled_date": "2016-11-04T18:52:36.323Z",
"latest_subtimeframe_available": "2016-11-05T00:00:00.000Z",
"milliseconds_behind": 3600000
}
52 changes: 52 additions & 0 deletions Keen.NET.Test/ApiResponses/GetDatasetResults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"result": [
{
"timeframe": {
"start": "2016-11-02T00:00:00.000Z",
"end": "2016-11-03T00:00:00.000Z"
},
"value": [
{
"item.name": "Golden Widget",
"result": 0
},
{
"item.name": "Silver Widget",
"result": 18
},
{
"item.name": "Bronze Widget",
"result": 1
},
{
"item.name": "Platinum Widget",
"result": 9
}
]
},
{
"timeframe": {
"start": "2016-11-03T00:00:00.000Z",
"end": "2016-11-04T00:00:00.000Z"
},
"value": [
{
"item.name": "Golden Widget",
"result": 1
},
{
"item.name": "Silver Widget",
"result": 13
},
{
"item.name": "Bronze Widget",
"result": 0
},
{
"item.name": "Platinum Widget",
"result": 3
}
]
}
]
}
60 changes: 60 additions & 0 deletions Keen.NET.Test/ApiResponses/ListDatasetDefinitions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"datasets": [
{
"project_id": "PROJECT_ID",
"organization_id": "ORGANIZATION_ID",
"dataset_name": "DATASET_NAME_1",
"display_name": "a first dataset wee",
"query": {
"project_id": "PROJECT_ID",
"analysis_type": "count",
"event_collection": "best collection",
"filters": [
{
"property_name": "request.foo",
"operator": "lt",
"property_value": 300
}
],
"timeframe": "this_500_hours",
"timezone": "US/Pacific",
"interval": "hourly",
"group_by": [
"exception.name"
]
},
"index_by": [
"project.id"
],
"last_scheduled_date": "2016-11-04T18:03:38.430Z",
"latest_subtimeframe_available": "2016-11-04T19:00:00.000Z",
"milliseconds_behind": 3600000
},
{
"project_id": "PROJECT_ID",
"organization_id": "ORGANIZATION_ID",
"dataset_name": "DATASET_NAME_10",
"display_name": "tenth dataset wee",
"query": {
"project_id": "PROJECT_ID",
"analysis_type": "count",
"event_collection": "tenth best collection",
"filters": [],
"timeframe": "this_500_days",
"timezone": "UTC",
"interval": "daily",
"group_by": [
"analysis_type"
]
},
"index_by": [
"project.organization.id"
],
"last_scheduled_date": "2016-11-04T19:28:36.639Z",
"latest_subtimeframe_available": "2016-11-05T00:00:00.000Z",
"milliseconds_behind": 3600000
}
],
"next_page_url": "https://api.keen.io/3.0/projects/PROJECT_ID/datasets?limit=LIMIT&after_name=DATASET_NAME_10",
"count": 4
}
Loading