many improvments
This commit is contained in:
1 parent
0e3fcb0cc2
commit
759aecd425
14 files changed
+92
-32
No files matched your search
@@ -7,6 +7,16 @@ of new features.
|
|||||||
* Support for [GeoJson](http://geojson.org/) indexes.
|
* Support for [GeoJson](http://geojson.org/) indexes.
|
||||||
* Support for GridFS
|
* Support for GridFS
|
||||||
|
|
||||||
|
|
||||||
|
### todo, version 1.
|
||||||
|
|
||||||
|
* ajouter liens de remerciment
|
||||||
|
* être capable de voir la carte avec l'image
|
||||||
|
* meilleur légende d'histogram
|
||||||
|
* Ajouter filtre à histogram
|
||||||
|
* Ajouter filtre à carte
|
||||||
|
* Être capable de chercher par objectId etc.
|
||||||
|
|
||||||
### screenshots
|
### screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"bitbucket.org/damyot/vulture/shared"
|
"bitbucket.org/damyot/vulture/shared"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"labix.org/v2/mgo"
|
"labix.org/v2/mgo"
|
||||||
"labix.org/v2/mgo/bson"
|
"labix.org/v2/mgo/bson"
|
||||||
@@ -89,7 +90,7 @@ func (this *VultureBackend) getIndexes() (interface{}, error) {
|
|||||||
}
|
}
|
||||||
ret := make([]map[string]interface{}, len(idxs))
|
ret := make([]map[string]interface{}, len(idxs))
|
||||||
for i, idx := range idxs {
|
for i, idx := range idxs {
|
||||||
ret[i] = map[string]interface{}{"name": idx.Name, "keys": idx.Key}
|
ret[i] = map[string]interface{}{"name": idx.Name, "keys": idx.Key, "unique": idx.Unique}
|
||||||
}
|
}
|
||||||
return ret, nil
|
return ret, nil
|
||||||
|
|
||||||
@@ -131,9 +132,11 @@ func (this *VultureBackend) wrapDocumentWithMetadata(doc interface{}, query *mgo
|
|||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *VultureBackend) GetStat(key string) (interface{}, error) {
|
func (this *VultureBackend) GetStat(query bson.M, key string) (interface{}, error) {
|
||||||
s := NewStatAggregator()
|
s := NewStatAggregator()
|
||||||
query := bson.M{key: bson.M{"$exists": true}}
|
if _, ok := query[key]; !ok {
|
||||||
|
query[key] = bson.M{"$exists": true}
|
||||||
|
}
|
||||||
iter := this.Collection.Find(query).Select(bson.M{key: 1}).Iter()
|
iter := this.Collection.Find(query).Select(bson.M{key: 1}).Iter()
|
||||||
result := make(map[string]interface{})
|
result := make(map[string]interface{})
|
||||||
|
|
||||||
@@ -158,9 +161,11 @@ func (this *VultureBackend) GetStat(key string) (interface{}, error) {
|
|||||||
return <-out, nil
|
return <-out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *VultureBackend) GetHistogram(key string, min, max float64, numberOfBins int) (interface{}, error) {
|
func (this *VultureBackend) GetHistogram(query bson.M, key string, min, max float64, numberOfBins int) (interface{}, error) {
|
||||||
hm := &HistogramMaker{min, max, numberOfBins}
|
hm := &HistogramMaker{min, max, numberOfBins}
|
||||||
query := bson.M{key: bson.M{"$exists": true}}
|
if _, ok := query[key]; !ok {
|
||||||
|
query[key] = bson.M{"$exists": true}
|
||||||
|
}
|
||||||
iter := this.Collection.Find(query).Select(bson.M{key: 1}).Iter()
|
iter := this.Collection.Find(query).Select(bson.M{key: 1}).Iter()
|
||||||
result := make(map[string]interface{})
|
result := make(map[string]interface{})
|
||||||
|
|
||||||
@@ -248,7 +253,7 @@ func getAllDocuments(w http.ResponseWriter, request *http.Request) (interface{},
|
|||||||
if !ok || queryString == "" {
|
if !ok || queryString == "" {
|
||||||
return vb.GetAllDocuments(nil)
|
return vb.GetAllDocuments(nil)
|
||||||
}
|
}
|
||||||
query := make(map[string]interface{})
|
query := make(bson.M)
|
||||||
if err := json.Unmarshal([]byte(queryString), &query); err != nil {
|
if err := json.Unmarshal([]byte(queryString), &query); err != nil {
|
||||||
return nil, errors.New("invalid json")
|
return nil, errors.New("invalid json")
|
||||||
}
|
}
|
||||||
@@ -302,12 +307,22 @@ func getStats(w http.ResponseWriter, request *http.Request) (interface{}, error)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
queryString, ok := mux.Vars(request)["query"]
|
||||||
|
query := make(map[string]interface{})
|
||||||
|
if ok && queryString != "" {
|
||||||
|
err := json.Unmarshal([]byte(queryString), &query)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("invalid json")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println(">>>", queryString)
|
||||||
|
|
||||||
vars := mux.Vars(request)
|
vars := mux.Vars(request)
|
||||||
key, ok := vars["key"]
|
key, ok := vars["key"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("key field not specified")
|
return nil, errors.New("key field not specified")
|
||||||
}
|
}
|
||||||
return vb.GetStat(key)
|
return vb.GetStat(query, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHistogram(w http.ResponseWriter, request *http.Request) (interface{}, error) {
|
func getHistogram(w http.ResponseWriter, request *http.Request) (interface{}, error) {
|
||||||
@@ -344,6 +359,14 @@ func getHistogram(w http.ResponseWriter, request *http.Request) (interface{}, er
|
|||||||
return nil, errors.New("key field not specified")
|
return nil, errors.New("key field not specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
return vb.GetHistogram(key, min, max, numberOfBins)
|
queryString, ok := vars["query"]
|
||||||
|
query := make(map[string]interface{})
|
||||||
|
if ok && queryString != "" {
|
||||||
|
err := json.Unmarshal([]byte(queryString), &query)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("invalid json")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vb.GetHistogram(query, key, min, max, numberOfBins)
|
||||||
}
|
}
|
||||||
@@ -49,6 +49,7 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$locat
|
|||||||
$scope.geojsonData = {}
|
$scope.geojsonData = {}
|
||||||
$scope.idx = Number($routeParams.idx)
|
$scope.idx = Number($routeParams.idx)
|
||||||
$scope.center = getLocalStorageCenter()
|
$scope.center = getLocalStorageCenter()
|
||||||
|
$scope.queryObject = $routeParams.query or "{}"
|
||||||
|
|
||||||
$scope.$watch 'center', () ->
|
$scope.$watch 'center', () ->
|
||||||
localStorage.setItem("mapCenter", JSON.stringify($scope.center))
|
localStorage.setItem("mapCenter", JSON.stringify($scope.center))
|
||||||
@@ -113,5 +114,11 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$locat
|
|||||||
else
|
else
|
||||||
$scope.mode = 'all'
|
$scope.mode = 'all'
|
||||||
$scope.initAllDocuments()
|
$scope.initAllDocuments()
|
||||||
|
|
||||||
|
$scope.changeQuery = (query) ->
|
||||||
|
if query == ""
|
||||||
|
return ""
|
||||||
|
r = $routeParams
|
||||||
|
$location.path "/#{ r.server }/#{ r.database }/#{ r.collection }/idx/1/query/#{query}/geojson/#{r.key}"
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -19,11 +19,12 @@ findHistogramMax = (stats) ->
|
|||||||
getAxisLabel = (min, stepSize, numberOfBins) ->
|
getAxisLabel = (min, stepSize, numberOfBins) ->
|
||||||
return (min + 0.5 * stepSize + i * stepSize for i in [0... numberOfBins])
|
return (min + 0.5 * stepSize + i * stepSize for i in [0... numberOfBins])
|
||||||
|
|
||||||
root.controllers.controller('keyStatCtrl', ['$scope', '$routeParams', 'util', ($scope, $routeParams, util) ->
|
root.controllers.controller('keyStatCtrl', ['$scope', '$routeParams', '$location', 'util', ($scope, $routeParams, $location, util) ->
|
||||||
$scope.name = $routeParams.key
|
$scope.name = $routeParams.key
|
||||||
$scope.stats = []
|
$scope.stats = []
|
||||||
|
$scope.queryObject = $routeParams.query or '{}'
|
||||||
base_url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }"
|
|
||||||
|
base_url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }/query/#{$scope.queryObject}"
|
||||||
stat_url = "#{ base_url }/stats/#{$routeParams.key}"
|
stat_url = "#{ base_url }/stats/#{$routeParams.key}"
|
||||||
|
|
||||||
$scope.alert=alert
|
$scope.alert=alert
|
||||||
@@ -47,6 +48,12 @@ root.controllers.controller('keyStatCtrl', ['$scope', '$routeParams', 'util', ($
|
|||||||
name: $routeParams.key
|
name: $routeParams.key
|
||||||
color: '#008CBA'
|
color: '#008CBA'
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
$scope.changeQuery = (query) ->
|
||||||
|
if query == ""
|
||||||
|
return ""
|
||||||
|
r = $routeParams
|
||||||
|
$location.path "/#{ r.server }/#{ r.database }/#{ r.collection }/stats/#{ r.key }/query/#{query}"
|
||||||
|
|
||||||
|
|
||||||
util.get(stat_url).then((res) ->
|
util.get(stat_url).then((res) ->
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ hasIndex = (keyName, indexes) ->
|
|||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
hasUniqueIndex = (keyName, indexes) ->
|
||||||
|
for index in indexes
|
||||||
|
if _.indexOf(index.keys, keyName) != -1
|
||||||
|
return index.unique
|
||||||
|
return false
|
||||||
|
|
||||||
hasIndexAsc = (keyName, indexes) ->
|
hasIndexAsc = (keyName, indexes) ->
|
||||||
hasIndex(keyName, indexes)
|
hasIndex(keyName, indexes)
|
||||||
|
|
||||||
@@ -17,7 +23,10 @@ has2dIndex = (keyName, indexes) ->
|
|||||||
|
|
||||||
getStatsUrl = (keyName, routeParams)->
|
getStatsUrl = (keyName, routeParams)->
|
||||||
r = routeParams
|
r = routeParams
|
||||||
"#/#{r.server}/#{r.database}/#{r.collection}/stats/#{ keyName }"
|
ret = "#/#{r.server}/#{r.database}/#{r.collection}/stats/#{ keyName }"
|
||||||
|
if r.query
|
||||||
|
ret = "#{ ret }/query/#{ r.query }"
|
||||||
|
return ret
|
||||||
|
|
||||||
directive = () ->
|
directive = () ->
|
||||||
directive =
|
directive =
|
||||||
@@ -34,6 +43,7 @@ directive = () ->
|
|||||||
$scope.statsUrl = getStatsUrl($scope.keyName, $routeParams)
|
$scope.statsUrl = getStatsUrl($scope.keyName, $routeParams)
|
||||||
$scope.hasIndexDesc = hasIndexDesc($scope.keyName, $scope.indexes)
|
$scope.hasIndexDesc = hasIndexDesc($scope.keyName, $scope.indexes)
|
||||||
$scope.hasIndexAsc = hasIndexAsc($scope.keyName, $scope.indexes)
|
$scope.hasIndexAsc = hasIndexAsc($scope.keyName, $scope.indexes)
|
||||||
|
$scope.isIndexUnique = hasUniqueIndex($scope.keyName, $scope.indexes)
|
||||||
$scope.has2DIndex = has2dIndex($scope.keyName, $scope.indexes)
|
$scope.has2DIndex = has2dIndex($scope.keyName, $scope.indexes)
|
||||||
$scope.showTools = false
|
$scope.showTools = false
|
||||||
$scope.hasIndex = $scope.hasIndexDown or $scope.hasIndexUp or $scope.has2DIndex
|
$scope.hasIndex = $scope.hasIndexDown or $scope.hasIndexUp or $scope.has2DIndex
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ config(['$routeProvider', ($routeProvider) ->
|
|||||||
$routeProvider.when('/:server/:database/:collection/_id/:id/field/:field', {templateUrl: 'partials/field.html', controller: 'fieldCtrl'})
|
$routeProvider.when('/:server/:database/:collection/_id/:id/field/:field', {templateUrl: 'partials/field.html', controller: 'fieldCtrl'})
|
||||||
$routeProvider.when('/:server/:database/:collection/idx/:idx', {templateUrl: 'partials/document.html', controller: 'documentCtrl'})
|
$routeProvider.when('/:server/:database/:collection/idx/:idx', {templateUrl: 'partials/document.html', controller: 'documentCtrl'})
|
||||||
$routeProvider.when('/:server/:database/:collection/stats/:key', {templateUrl: 'partials/keyStat.html', controller: 'keyStatCtrl'})
|
$routeProvider.when('/:server/:database/:collection/stats/:key', {templateUrl: 'partials/keyStat.html', controller: 'keyStatCtrl'})
|
||||||
|
$routeProvider.when('/:server/:database/:collection/stats/:key/query/:query', {templateUrl: 'partials/keyStat.html', controller: 'keyStatCtrl'})
|
||||||
$routeProvider.when('/:server/:database/:collection/idx/:idx/query/:query', {templateUrl: 'partials/document.html', controller: 'documentCtrl'})
|
$routeProvider.when('/:server/:database/:collection/idx/:idx/query/:query', {templateUrl: 'partials/document.html', controller: 'documentCtrl'})
|
||||||
$routeProvider.when('/:server/:database/:collection/idx/all/geojson/:key', {templateUrl: 'partials/geojsonmap.html', controller: 'geojsonmapCtrl'})
|
$routeProvider.when('/:server/:database/:collection/idx/all/geojson/:key', {templateUrl: 'partials/geojsonmap.html', controller: 'geojsonmapCtrl'})
|
||||||
$routeProvider.when('/:server/:database/:collection/idx/:idx/geojson/:key', {templateUrl: 'partials/geojsonmap.html', controller: 'geojsonmapCtrl'})
|
$routeProvider.when('/:server/:database/:collection/idx/:idx/geojson/:key', {templateUrl: 'partials/geojsonmap.html', controller: 'geojsonmapCtrl'})
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<span ng-mouseenter="showTools=true" ng-mouseleave="showTools=false">
|
<span ng-mouseenter="showTools=true" ng-mouseleave="showTools=false">
|
||||||
{{keyName}}
|
{{keyName}}
|
||||||
|
|
||||||
<span ng-style="{visibility: showTools ? 'inline': 'hidden'}">
|
|
||||||
<!-- place to but some hoover information-->
|
<span class="right" >
|
||||||
<a ng-href="{{ statsUrl }}"><i class="fa fa-signal" ng-show="canMakeHistogram"></i></a>
|
<a ng-href="{{ statsUrl }}" title="histogram"><i class="fa fa-signal" ng-show="canMakeHistogram"></i></a>
|
||||||
</span>
|
<span ng-show="isIndexUnique" title="unique index">∃!</span>
|
||||||
<span class="right" style="color:#008CBA;">
|
<i class="fa fa-sort-numeric-asc" title="ascending index" ng-show="hasIndexAsc"></i>
|
||||||
<i class="fa fa-sort-numeric-asc" ng-show="hasIndexAsc"></i>
|
<i class="fa fa-sort-numeric-desc" title="descending index" ng-show="hasIndexDesc"></i>
|
||||||
<i class="fa fa-sort-numeric-desc" ng-show="hasIndexDesc"></i>
|
<a class="fa fa-globe" ng-show="has2DIndex" ng-href="{{ getGeoJsonUrl() }}" target="_blank" title="2dsphere index"></a>
|
||||||
<a class="fa fa-globe" ng-show="has2DIndex" ng-href="{{ getGeoJsonUrl() }}" target="_blank"></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-9 columns">
|
<div class="large-9 columns">
|
||||||
<input type="text" ng-model="newQuery" style="font-family: monospace;font-size: 1.2em;">
|
<input type="text" ng-model="newQuery" style="font-family: monospace;font-size: 1.1em;">
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns right">
|
<div class="large-3 columns right">
|
||||||
<ul class="button-group">
|
<ul class="button-group">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-12 columns" style="text-align: center;">
|
<div class="large-12 columns" style="text-align: center;">
|
||||||
<a class="fa fa-chevron-left" ng-href="{{ previousDocumentUrl() }}" ng-show="{{ hasPreviousDocument() }}"></a>
|
<a class="fa fa-chevron-left" ng-href="{{ previousDocumentUrl() }}" ng-show="{{ hasPreviousDocument() }}"></a>
|
||||||
<kbd>{{idx}} / {{ meta.count || 0 | number | replaceAllCommasBySpaces }}</kbd>
|
<kbd>{{idx}} / {{ meta.count + idx - 1 || 0 | number | replaceAllCommasBySpaces }}</kbd>
|
||||||
<a class="fa fa-chevron-right" ng-href="{{ nextDocumentUrl() }}"></a>
|
<a class="fa fa-chevron-right" ng-href="{{ nextDocumentUrl() }}"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
|
<vul-search-bar query="{{ queryObject }}" callback="changeQuery"></vul-search-bar>
|
||||||
|
|
||||||
|
|
||||||
<div class="row" ng-show="mode=='single_document'">
|
<div class="row" ng-show="mode=='single_document'">
|
||||||
<div class="large-12 columns" style="text-align: center;">
|
<div class="large-12 columns" style="text-align: center;">
|
||||||
<a class="fa fa-chevron-left" ng-href="{{ previousDocumentUrl() }}" ng-show="{{ hasPreviousDocument() }}"></a>
|
<a class="fa fa-chevron-left" ng-href="{{ previousDocumentUrl() }}" ng-show="{{ hasPreviousDocument() }}"></a>
|
||||||
<kbd>{{idx}} / {{ meta.count }}</kbd>
|
<kbd>{{idx}} / {{ meta.count + idx - 1}}</kbd>
|
||||||
<a class="fa fa-chevron-right" ng-href="{{ nextDocumentUrl() }}"></a>
|
<a class="fa fa-chevron-right" ng-href="{{ nextDocumentUrl() }}"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="mode=='all'">
|
<div class="row" ng-show="mode=='all'">
|
||||||
<div class="large-12 columns" style="text-align: center;">
|
<div class="large-12 columns" style="text-align: center;">
|
||||||
<span>Showing a data set of {{geojsonData.data.geometries.length}} datum.</span>
|
<span>Showing {{meta.count}} documents on the same map.</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<vul-search-bar query="queryObject" callback="alert"></vul-search-bar>
|
<vul-search-bar query="{{ queryObject }}" callback="changeQuery"></vul-search-bar>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="columns large-12">
|
<div class="columns large-12">
|
||||||
@@ -13,5 +13,5 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<highchart id="chart1" config="chartConfig" class="columns large-12"></highchart>
|
<highchart id="chart1" config="chartConfig" class="columns large-12"></highchart>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,8 +91,8 @@ func serveApi(router *mux.Router) {
|
|||||||
router.Handle("/{server}/{database}/collections", ApiHandler(getAvailableCollections))
|
router.Handle("/{server}/{database}/collections", ApiHandler(getAvailableCollections))
|
||||||
router.Handle("/{server}/{database}/{collection}/idx/{index:[0-9]+}", ApiHandler(getDocumentByIndex))
|
router.Handle("/{server}/{database}/{collection}/idx/{index:[0-9]+}", ApiHandler(getDocumentByIndex))
|
||||||
router.Handle("/{server}/{database}/{collection}/_id/{id}", ApiHandler(getDocumentById))
|
router.Handle("/{server}/{database}/{collection}/_id/{id}", ApiHandler(getDocumentById))
|
||||||
router.Handle("/{server}/{database}/{collection}/stats/{key}", ApiHandler(getStats))
|
router.Handle("/{server}/{database}/{collection}/query/{query}/stats/{key}", ApiHandler(getStats))
|
||||||
router.Handle("/{server}/{database}/{collection}/histogram/{key}/{min}/{max}/{number_of_bins}", ApiHandler(getHistogram))
|
router.Handle("/{server}/{database}/{collection}/query/{query}/histogram/{key}/{min}/{max}/{number_of_bins}", ApiHandler(getHistogram))
|
||||||
router.Handle("/{server}/{database}/{collection}/all", ApiHandler(getAllDocuments))
|
router.Handle("/{server}/{database}/{collection}/all", ApiHandler(getAllDocuments))
|
||||||
router.Handle("/{server}/{database}/{collection}/query/{query}/idx/{index:[0-9]+}", ApiHandler(getDocumentByQueryAndIndex))
|
router.Handle("/{server}/{database}/{collection}/query/{query}/idx/{index:[0-9]+}", ApiHandler(getDocumentByQueryAndIndex))
|
||||||
router.Handle("/{server}/{database}/{collection}/query/{query}/all", ApiHandler(getAllDocuments))
|
router.Handle("/{server}/{database}/{collection}/query/{query}/all", ApiHandler(getAllDocuments))
|
||||||
|
|||||||
+3
-3
@@ -7,9 +7,9 @@
|
|||||||
# The port where the service will run
|
# The port where the service will run
|
||||||
Port: 8000
|
Port: 8000
|
||||||
|
|
||||||
# The address where the service will run. If you wish to run it on your computer, you
|
# The address where the service will run. If you wish to run it on your
|
||||||
# should use `localhost`. If you wish to share the service on your local network, you
|
# computer, you should use `localhost`. If you wish to share the service
|
||||||
# should use `0.0.0.0`
|
# on your local network, you should use `0.0.0.0`
|
||||||
ServingAddress: 0.0.0.0
|
ServingAddress: 0.0.0.0
|
||||||
|
|
||||||
# The list of mongo servers. Each server is an object with a field *name* that will
|
# The list of mongo servers. Each server is an object with a field *name* that will
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func (this *HistogramMaker) MakeHistogram(dataChannel chan float64, outputChanne
|
|||||||
}
|
}
|
||||||
i := this.findSuitableBinForDatum(this.Min, step, datum)
|
i := this.findSuitableBinForDatum(this.Min, step, datum)
|
||||||
if i >= len(hist) || i < 0 {
|
if i >= len(hist) || i < 0 {
|
||||||
log.Println("what the fuck?!", this.Min, step, datum, i)
|
log.Println("bad bin format", this.Min, step, datum, i)
|
||||||
} else {
|
} else {
|
||||||
hist[i]++
|
hist[i]++
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user