Comments (3)
Hi Vincent,
Thank you for taking the time to e-mail us your library. I agree with
you that your approach is much cleaner. Is it OK if we include your
library on our list of 3rd-party libraries here:
http://support.kissmetrics.com/apis/other?
-John
On Wed, Aug 24, 2011 at 10:57 PM, vbrendel
[email protected]
wrote:
Hi KM,
I had a few issues with your gem and eventually decided it was easier to create my own code to interface with Kissmetrics and would like to share it with you what the problems were and what I came up with.
The first problem was around environments and the use of logs and cron and I had to work around the fact that the code executes differently in production. I would recommend that rather than hardcode behavior around environments to make this configurable instead. For example, I use an environment called 'staging' which should behave exactly like production, except it has a different name.
Also, as you may know, Heroku only allows hourly cron jobs so that meant the stats were not instant. And then I didn't see a distinct advantage to holding the logs in a file since they are sent one-by-one anyway. Finally, using the file system, in particular the tmp dir for storing the log posed the potential problem of logs possibly being deleted by automatic cleanup processes.
Because Heroku works well with delayed_job, that was my preferred method for sending metrics.
So please find my version of the KM class in the gist below. It's a bit of a work in progress since it only does what I need but so far it works well for me.
https://gist.github.com/1170061 (required: delayed_job and httparty gems)
Thanks,
VincentReply to this email directly or view it on GitHub:
#3
from km.
Hi John,
Absolutely, and I've now started a repo for it, so please feel free to
reference: https://github.com/vbrendel/delayed_km
Cheers,
Vincent
On Sat, Aug 27, 2011 at 1:56 AM, kmjbutler <
[email protected]>wrote:
Hi Vincent,
Thank you for taking the time to e-mail us your library. I agree with
you that your approach is much cleaner. Is it OK if we include your
library on our list of 3rd-party libraries here:
http://support.kissmetrics.com/apis/other?-John
On Wed, Aug 24, 2011 at 10:57 PM, vbrendel
[email protected]
wrote:Hi KM,
I had a few issues with your gem and eventually decided it was easier to
create my own code to interface with Kissmetrics and would like to share it
with you what the problems were and what I came up with.The first problem was around environments and the use of logs and cron
and I had to work around the fact that the code executes differently in
production. I would recommend that rather than hardcode behavior around
environments to make this configurable instead. For example, I use an
environment called 'staging' which should behave exactly like production,
except it has a different name.Also, as you may know, Heroku only allows hourly cron jobs so that meant
the stats were not instant. And then I didn't see a distinct advantage to
holding the logs in a file since they are sent one-by-one anyway. Finally,
using the file system, in particular the tmp dir for storing the log posed
the potential problem of logs possibly being deleted by automatic cleanup
processes.Because Heroku works well with delayed_job, that was my preferred method
for sending metrics.So please find my version of the KM class in the gist below. It's a bit
of a work in progress since it only does what I need but so far it works
well for me.https://gist.github.com/1170061 (required: delayed_job and httparty
gems)Thanks,
VincentReply to this email directly or view it on GitHub:
#3Reply to this email directly or view it on GitHub:
#3 (comment)
from km.
I've added it to our list: http://support.kissmetrics.com/apis/other.
Thanks again for your efforts!
-John
On Fri, Aug 26, 2011 at 6:08 PM, vbrendel
[email protected]
wrote:
Hi John,
Absolutely, and I've now started a repo for it, so please feel free to
reference: https://github.com/vbrendel/delayed_kmCheers,
VincentOn Sat, Aug 27, 2011 at 1:56 AM, kmjbutler <
[email protected]>wrote:Hi Vincent,
Thank you for taking the time to e-mail us your library. I agree with
you that your approach is much cleaner. Is it OK if we include your
library on our list of 3rd-party libraries here:
http://support.kissmetrics.com/apis/other?-John
On Wed, Aug 24, 2011 at 10:57 PM, vbrendel
[email protected]
wrote:Hi KM,
I had a few issues with your gem and eventually decided it was easier to
create my own code to interface with Kissmetrics and would like to share it
with you what the problems were and what I came up with.The first problem was around environments and the use of logs and cron
and I had to work around the fact that the code executes differently in
production. I would recommend that rather than hardcode behavior around
environments to make this configurable instead. For example, I use an
environment called 'staging' which should behave exactly like production,
except it has a different name.Also, as you may know, Heroku only allows hourly cron jobs so that meant
the stats were not instant. And then I didn't see a distinct advantage to
holding the logs in a file since they are sent one-by-one anyway. Finally,
using the file system, in particular the tmp dir for storing the log posed
the potential problem of logs possibly being deleted by automatic cleanup
processes.Because Heroku works well with delayed_job, that was my preferred method
for sending metrics.So please find my version of the KM class in the gist below. It's a bit
of a work in progress since it only does what I need but so far it works
well for me.https://gist.github.com/1170061 (required: delayed_job and httparty
gems)Thanks,
VincentReply to this email directly or view it on GitHub:
#3Reply to this email directly or view it on GitHub:
#3 (comment)Reply to this email directly or view it on GitHub:
#3 (comment)
from km.
Related Issues (15)
- KM Isn't Threadsafe HOT 1
- Connection times out when get request too large HOT 2
- License HOT 1
- Need a rubygems.org release for development testing HOT 3
- Don't rescue Exception
- uninitialized constant ApplicationController::KM for kmts gem (kmts gem doesn't work) HOT 4
- README for kmts is wrong HOT 2
- Why rename? HOT 1
- 'kmts' gem yanked ? what's the alternative? HOT 10
- Requiring the kmts gem doesn't work HOT 3
- KM Gem replacing spaces with "+" HOT 4
- kissmetrics_production_sent.log is never pruned
- log file is opened for each event
- Sending events not related to the browsing user is not possible HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from km.