user-metrics
v1.0.1
Published
general propouse user metrics api
Downloads
1
Readme
User Metrics
User metrics é uma api de propósito geral para armazenamento de métricas de aplicações web
How to Use
Add usermetrics in HTML
<script src="../userMetrics.js"></script>
Instantiate userMetrics sending urlServer database api
<script> var metrics = new UserMetrics(<urlServer>); </script>
Start the Metrics sending the actual page name and the user Object
<script> ... metrics.startMetrics("Home",{username:"user", email :"[email protected]", id:1}); </script>
Stop the metrics sending de meta data to be stored
<script> ... metrics.stopMetrics({metaData1 : 1, metaData2 : "Some String", metaData3 : false}); </script>
Sending metrics to server api database
<script> ... metrics.postMetrics().then( function(rep){ console.log(rep) },function(err){ console.log(err) }); </script>