fixed window build error. bump 1.4.1
This commit is contained in:
parent
0cf5fabfa5
commit
53e3326d75
@ -5,7 +5,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://travis-ci.org/tidwall/tile38"><img src="https://travis-ci.org/tidwall/tile38.svg?branch=master" alt="Build Status"></a>
|
<a href="https://travis-ci.org/tidwall/tile38"><img src="https://travis-ci.org/tidwall/tile38.svg?branch=master" alt="Build Status"></a>
|
||||||
<a href="https://github.com/tidwall/tile38/releases"><img src="https://img.shields.io/badge/version-1.4.0-green.svg" alt="Version"></a>
|
<a href="https://github.com/tidwall/tile38/releases"><img src="https://img.shields.io/badge/version-1.4.1-green.svg" alt="Version"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofence. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.
|
Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofence. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.
|
||||||
|
2
build.sh
2
build.sh
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION="1.3.0"
|
VERSION="1.4.1"
|
||||||
PROTECTED_MODE="no"
|
PROTECTED_MODE="no"
|
||||||
|
|
||||||
# Hardcode some values to the core package
|
# Hardcode some values to the core package
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/tidwall/btree"
|
"github.com/tidwall/btree"
|
||||||
@ -169,22 +168,6 @@ func (c *Controller) writeInfoStats(w *bytes.Buffer) {
|
|||||||
func (c *Controller) writeInfoReplication(w *bytes.Buffer) {
|
func (c *Controller) writeInfoReplication(w *bytes.Buffer) {
|
||||||
fmt.Fprintf(w, "connected_slaves:%d\r\n", len(c.aofconnM)) // Number of connected slaves
|
fmt.Fprintf(w, "connected_slaves:%d\r\n", len(c.aofconnM)) // Number of connected slaves
|
||||||
}
|
}
|
||||||
func (c *Controller) writeInfoCPU(w *bytes.Buffer) {
|
|
||||||
var selfRu syscall.Rusage
|
|
||||||
var cRu syscall.Rusage
|
|
||||||
syscall.Getrusage(syscall.RUSAGE_SELF, &selfRu)
|
|
||||||
syscall.Getrusage(syscall.RUSAGE_CHILDREN, &cRu)
|
|
||||||
fmt.Fprintf(w,
|
|
||||||
"used_cpu_sys:%.2f\r\n"+
|
|
||||||
"used_cpu_user:%.2f\r\n"+
|
|
||||||
"used_cpu_sys_children:%.2f\r\n"+
|
|
||||||
"used_cpu_user_children:%.2f\r\n",
|
|
||||||
float64(selfRu.Stime.Sec)+float64(selfRu.Stime.Usec/1000000),
|
|
||||||
float64(selfRu.Utime.Sec)+float64(selfRu.Utime.Usec/1000000),
|
|
||||||
float64(cRu.Stime.Sec)+float64(cRu.Stime.Usec/1000000),
|
|
||||||
float64(cRu.Utime.Sec)+float64(cRu.Utime.Usec/1000000),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
func (c *Controller) writeInfoCluster(w *bytes.Buffer) {
|
func (c *Controller) writeInfoCluster(w *bytes.Buffer) {
|
||||||
fmt.Fprintf(w, "cluster_enabled:0\r\n")
|
fmt.Fprintf(w, "cluster_enabled:0\r\n")
|
||||||
}
|
}
|
||||||
|
18
controller/stats_cpu.go
Normal file
18
controller/stats_cpu.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// +build !linux,!darwin
|
||||||
|
|
||||||
|
package controller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (c *Controller) writeInfoCPU(w *bytes.Buffer) {
|
||||||
|
fmt.Fprintf(w,
|
||||||
|
"used_cpu_sys:%.2f\r\n"+
|
||||||
|
"used_cpu_user:%.2f\r\n"+
|
||||||
|
"used_cpu_sys_children:%.2f\r\n"+
|
||||||
|
"used_cpu_user_children:%.2f\r\n",
|
||||||
|
0, 0, 0, 0,
|
||||||
|
)
|
||||||
|
}
|
26
controller/stats_cpu_darlin.go
Normal file
26
controller/stats_cpu_darlin.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// +build linux darwin
|
||||||
|
|
||||||
|
package controller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (c *Controller) writeInfoCPU(w *bytes.Buffer) {
|
||||||
|
var selfRu syscall.Rusage
|
||||||
|
var cRu syscall.Rusage
|
||||||
|
syscall.Getrusage(syscall.RUSAGE_SELF, &selfRu)
|
||||||
|
syscall.Getrusage(syscall.RUSAGE_CHILDREN, &cRu)
|
||||||
|
fmt.Fprintf(w,
|
||||||
|
"used_cpu_sys:%.2f\r\n"+
|
||||||
|
"used_cpu_user:%.2f\r\n"+
|
||||||
|
"used_cpu_sys_children:%.2f\r\n"+
|
||||||
|
"used_cpu_user_children:%.2f\r\n",
|
||||||
|
float64(selfRu.Stime.Sec)+float64(selfRu.Stime.Usec/1000000),
|
||||||
|
float64(selfRu.Utime.Sec)+float64(selfRu.Utime.Usec/1000000),
|
||||||
|
float64(cRu.Stime.Sec)+float64(cRu.Stime.Usec/1000000),
|
||||||
|
float64(cRu.Utime.Sec)+float64(cRu.Utime.Usec/1000000),
|
||||||
|
)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user