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 type response() View Source
response() :: {status(), map()}
Link to this type status() View Source
status() :: :ok | :error

Link to this section Functions

Link to this function add_event(event_collection, data) View Source
add_event(binary(), map()) :: Keenex.response()

Publishes an event into the event collection

Keenex.add_event("dinner.tacos", %{data: "data"})
Link to this function add_events(events) View Source
add_events(map()) :: Keenex.response()

Publishes multiple events to one or more event collections

Keenex.add_events(%{event_collection1: [%{data: "data"}], event_collection2: [%{data: "data"}, %{more_data: "data"}]})
Link to this function average(event_collection, target_property, params \\ %{}) View Source
average(binary(), binary(), map()) :: Keenex.response()

Calculate the average value for a target property, among all events in a collection matching given criteria.

Link to this function count(event_collection, params \\ %{}) View Source
count(binary(), map()) :: Keenex.response()

Returns the number of events in a collection matching the given criteria

Link to this function count_unique(event_collection, target_property, params \\ %{}) View Source
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

Link to this function extraction(event_collection, params \\ %{}) View Source
extraction(binary(), map()) :: Keenex.response()

Creates an extraction request for full-form event data with all property values.

Link to this function funnel(steps, params \\ %{}) View Source

Returns the number of unique actors that successfully (or unsuccessfully) make it through a series of steps

Link to this function inspect(event_collection) View Source
inspect(binary()) :: Keenex.response()

Returns schema for a single event collection

Keenex.inspect("dinner.tacos")

Returns schema for all event collections

Keenex.inspect_all()
Link to this function maximum(event_collection, target_property, params \\ %{}) View Source
maximum(binary(), binary(), map()) :: Keenex.response()

Return the maximum numeric value for a target property, among all events in a collection matching given criteria.

Link to this function median(event_collection, target_property, params \\ %{}) View Source
median(binary(), binary(), map()) :: Keenex.response()

Calculate the median value for a target property, among all events in a collection matching given criteria.

Link to this function minimum(event_collection, target_property, params \\ %{}) View Source
minimum(binary(), binary(), map()) :: Keenex.response()

Return the minimum numeric value for a target property, among all events in a collection matching given criteria.

Link to this function multi_analysis(event_collection, analyses, params \\ %{}) View Source
multi_analysis(binary(), map(), map()) :: Keenex.response()

Runs multiple types of analyses over the same data

Link to this function percentile(event_collection, target_property, percentile, params \\ %{}) View Source
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.

Link to this function select_unique(event_collection, target_property, params \\ %{}) View Source
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.

Link to this function sum(event_collection, target_property, params \\ %{}) View Source
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.