Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stats about handsets

  • Loading branch information...
commit bc7c375b4b55359590bbc90d5eaabbe203f33adf 1 parent f2606ae
@alumae authored
Showing with 10 additions and 1 deletion.
  1. +5 −1 lib/server.rb
  2. +5 −0 scripts/log2models-txt.sh
View
6 lib/server.rb
@@ -88,10 +88,14 @@ def LOGGER.write(*s)
get '/stats/apps.txt' do
headers "Content-Type" => "text/plain"
- `mkdir -p tmp`
`./scripts/log2apps-txt.sh server.log`
end
+ get '/stats/models.txt' do
+ headers "Content-Type" => "text/plain"
+ `./scripts/log2models-txt.sh server.log`
+ end
+
post '/recognize' do
do_post()
end
View
5 scripts/log2models-txt.sh
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+egrep "^I, \[.*INFO.*User agent.* \(RecognizerIntentActivity.*; ([^;]+\/[^;]+\/[^;]+); " $1 |
+perl -npe 's/.*User agent.* \(RecognizerIntentActivity.*; ([^;]+\/[^;]+\/[^;]+);.*/\1/' |
+sort | uniq -c | sort -nr -k1
Please sign in to comment.
Something went wrong with that request. Please try again.