Skip to content

Commit

Permalink
Merge pull request #1 from asecurityteam/migrate
Browse files Browse the repository at this point in the history
Update metafiles after repo migration
  • Loading branch information
kconwayatlassian authored Feb 25, 2019
2 parents eaf8608 + 2ddc3b0 commit b6ee98c
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties

# VSCODE
.vscode

# -*- mode: gitignore; -*-
*~
\#*\#
Expand Down
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: go
go:
- 1.11.x
services:
- docker
install:
- go get -u golang.org/x/tools/cmd/goimports
- go get -u github.com/alecthomas/gometalinter
script:
- if [[ "$(goimports -l -d .)" != "" ]]; then echo "$(goimports -l -d .)" && exit 1; fi
- gometalinter --install --update
- gometalinter --vendor --disable-all --enable=vet --enable=vetshadow --enable=golint --enable=ineffassign --enable=goconst --tests .
- echo '# Generate coverage report and test for race conditions'
- go test -race -cover
- echo '# Generate a CPU benchmark'
- go test -bench .
- echo '# Generate a memory benchmark'
- go test -bench . -benchmem
31 changes: 31 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Prerequisites

* Checked that your issue isn't already filed: [https://gihub.com/asecurityteam/rolling/issues?status=new&status=open](https://gihub.com/asecurityteam/rolling/issues?status=new&status=open)

### Description

[Description of the issue]

### Steps to Reproduce

1. [First Step]
2. [Second Step]
3. [and so on...]

**Expected behavior:** [What you expect to happen]

**Actual behavior:** [What actually happens]

**Reproduces how often:** [What percentage of the time does it reproduce?]

###Did this work in previous versions of rolling?

Yes / No / Don't know

### Compiler and OS information

Please include the compiler version, OS and OS version you're running.

### Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.
39 changes: 30 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# rolling #
<a id="markdown-rolling" name="rolling"></a>
# rolling

**A rolling/sliding window implementation for Google-golang**

## Usage ##
<!-- TOC -->

### Point Window ###
- [rolling](#rolling)
- [Usage](#usage)
- [Point Window](#point-window)
- [Time Window](#time-window)
- [Aggregating Windows](#aggregating-windows)
- [Custom Aggregations](#custom-aggregations)
- [Contributors](#contributors)
- [License](#license)

<!-- /TOC -->

<a id="markdown-usage" name="usage"></a>
## Usage

<a id="markdown-point-window" name="point-window"></a>
### Point Window

```golang
var p = rolling.NewPointPolicy(rolling.NewWindow(5))
Expand Down Expand Up @@ -35,7 +51,8 @@ latest to preserve the specified value count. This type of window is useful
for collecting data that have a known interval on which they are capture or
for tracking data where time is not a factor.

### Time Window ###
<a id="markdown-time-window" name="time-window"></a>
### Time Window

```golang
var p = rolling.NewTimeWindow(rolling.NewWindow(3000), time.Millisecond)
Expand Down Expand Up @@ -63,7 +80,8 @@ duration then the less data are lost when a bucket expires.
This type of bucket is most useful for collecting real-time values such as
request rates, error rates, and latencies of operations.

## Aggregating Windows ##
<a id="markdown-aggregating-windows" name="aggregating-windows"></a>
## Aggregating Windows

Each window exposes a `Reduce(func(w Window) float64) float64` method that can
be used to aggregate the data stored within. The method takes in a function
Expand All @@ -82,7 +100,7 @@ fmt.Println(p.Reduce(rolling.FastPercentile(99.9)))

The `Count`, `Avg`, `Min`, `Max`, and `Sum` each perform their expected
computation. The `Percentile` aggregator first takes the target percentile and
returns an aggregating function that works identically to the `Sum`, et all.
returns an aggregating function that works identically to the `Sum`, et al.

For cases of very large datasets, the `FastPercentile` can be used as a
replacement for the standard percentile calculation. This alternative version
Expand All @@ -92,7 +110,8 @@ vary from the *actual* percentile by a small amount. It's a tradeoff of accuracy
for speed when calculating percentiles from large data sets. For more on the
p-squared algorithm see: <http://www.cs.wustl.edu/~jain/papers/ftp/psqr.pdf>.

#### Custom Aggregations ####
<a id="markdown-custom-aggregations" name="custom-aggregations"></a>
#### Custom Aggregations

Any function that matches the form of `func(rolling.Window)float64` may be given
to the `Reduce` method of any window policy. The `Window` type is a named
Expand All @@ -111,7 +130,8 @@ func MyAggregate(w rolling.Window) float64 {
}
```

## Contributors ##
<a id="markdown-contributors" name="contributors"></a>
## Contributors

Pull requests, issues and comments welcome. For pull requests:

Expand All @@ -138,7 +158,8 @@ those contributing as an individual.
* [CLA for corporate contributors](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=e1c17c66-ca4d-4aab-a953-2c231af4a20b)
* [CLA for individuals](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=3f94fbdc-2fbe-46ac-b14c-5d152700ae5d)

## License ##
<a id="markdown-license" name="license"></a>
## License

Copyright (c) 2017 Atlassian and others.
Apache 2.0 licensed, see [LICENSE.txt](LICENSE.txt) file.
18 changes: 0 additions & 18 deletions bitbucket-pipelines.yml

This file was deleted.

0 comments on commit b6ee98c

Please sign in to comment.