keenex v1.1.0 Keenex View Source
Keenex provides an Elixir interface to the Keen.io HTTP API.
Usage
Add it to your applications and dependencies in mix.exs:
def application do
[applications: [:keenex]]
end
def deps do
[{:keenex, "~> 1.0"}]
end
Configure it in config.exs:
config :keenex,
project_id: "xxxxx", # defaults to System.get_env("KEEN_PROJECT_ID")
read_key: "xxxxx", # defaults to System.get_env("KEEN_READ_KEY")
write_key: "xxxxx", # defaults to System.get_env("KEEN_WRITE_KEY")
httpoison_opts: [timeout: 5000] # defaults to []
And then call functions like:
{status, response} = Keenex.add_event("dinner.tacos", %{test: "tacos"})
status is either :ok or :error.
response is a Map converted from the JSON response from Keen.
Information about the contents of the response can be found
here.
Link to this section Summary
Functions
Publishes an event into the event collection
Publishes multiple events to one or more event collections
Calculate the average value for a target property, among all events in a collection matching given criteria
Returns the number of events in a collection matching the given criteria
Return the number of events with unique values, for a target property in a collection matching given criteria
Creates an extraction request for full-form event data with all property values
Returns the number of unique actors that successfully (or unsuccessfully) make it through a series of steps
Returns schema for a single event collection
Returns schema for all event collections
Return the maximum numeric value for a target property, among all events in a collection matching given criteria
Calculate the median value for a target property, among all events in a collection matching given criteria
Return the minimum numeric value for a target property, among all events in a collection matching given criteria
Runs multiple types of analyses over the same data
Calculate a specified percentile value for a target property, among all events in a collection matching given criteria
Return a list of unique property values for a target property, among all events in a collection matching given criteria
Starts Keenex app
Calculate the sum of all numeric values for a target property, among all events in a collection matching given criteria
Link to this section Types
Link to this section Functions
add_event(binary(), map()) :: Keenex.response()
Publishes an event into the event collection
Keenex.add_event("dinner.tacos", %{data: "data"})
Publishes multiple events to one or more event collections
Keenex.add_events(%{event_collection1: [%{data: "data"}], event_collection2: [%{data: "data"}, %{more_data: "data"}]})
average(binary(), binary(), map()) :: Keenex.response()
Calculate the average value for a target property, among all events in a collection matching given criteria.
count(binary(), map()) :: Keenex.response()
Returns the number of events in a collection matching the given criteria
count_unique(binary(), binary(), map()) :: Keenex.response()
Return the number of events with unique values, for a target property in a collection matching given criteria
extraction(binary(), map()) :: Keenex.response()
Creates an extraction request for full-form event data with all property values.
Returns the number of unique actors that successfully (or unsuccessfully) make it through a series of steps
Returns schema for a single event collection
Keenex.inspect("dinner.tacos")
Returns schema for all event collections
Keenex.inspect_all()
maximum(binary(), binary(), map()) :: Keenex.response()
Return the maximum numeric value for a target property, among all events in a collection matching given criteria.
median(binary(), binary(), map()) :: Keenex.response()
Calculate the median value for a target property, among all events in a collection matching given criteria.
minimum(binary(), binary(), map()) :: Keenex.response()
Return the minimum numeric value for a target property, among all events in a collection matching given criteria.
multi_analysis(binary(), map(), map()) :: Keenex.response()
Runs multiple types of analyses over the same data
percentile(binary(), binary(), integer(), map()) :: Keenex.response()
Calculate a specified percentile value for a target property, among all events in a collection matching given criteria.
select_unique(binary(), binary(), map()) :: Keenex.response()
Return a list of unique property values for a target property, among all events in a collection matching given criteria.
Starts Keenex app.
sum(binary(), binary(), map()) :: Keenex.response()
Calculate the sum of all numeric values for a target property, among all events in a collection matching given criteria.