Commit Graph

27 Commits

Author SHA1 Message Date
Wojciech Tyczynski
e610c137c0 Regenerate auto-generated files 2016-03-17 09:30:02 +01:00
derekwaynecarr
2ad322f295 Add or subtract from zero should not lose format 2016-02-04 13:16:47 -05:00
Tim St. Clair
40e90886e6 Add micro- and nano- suffixes 2016-01-04 14:08:24 -08:00
Tim St. Clair
b4116eb718 Handle nil Amount in resource.Quantity.{Add,Sub}
Treat `nil` Amount as 0 in `resource.Quantity.Add` and
`resource.Quantity.Sub`. Also, allow adding/subtracting resources with
different Formats (since Format has no effect on the underlying value).
2015-12-10 19:24:23 -08:00
Wojciech Tyczynski
029d906074 Merge pull request #18170 from xiang90/scale
api/resource: optimize scale function
2015-12-09 16:18:28 +01:00
Clayton Coleman
9fea762917 Add protobuf preparation objects, guarded by proto tag 2015-12-05 18:15:48 -05:00
Xiang Li
cf82d6b004 resource: optimize scale function
The original scale function takes around 800ns/op with more
than 10 allocations. It significantly slow down scheduler
and other components that heavily relys on resource pkg.
For more information see #18126.

This pull request tries to optimize scale function. It takes
two approach:

1. when the value is small, only use normal math ops.
2. when the value is large, use math.Big with buffer pool.

The final result is:

BenchmarkScaledValueSmall-4	20000000	        66.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkScaledValueLarge-4	 2000000	       711 ns/op	      48 B/op	       1 allocs/op

I also run the scheduler benchmark again. It doubles the throughput of
scheduler for 1000 nodes case.
2015-12-03 17:00:13 -08:00
hurf
5cc909afe7 Remove type validation in resource.Quantity.Add
The type validation is unnecessary for add and will cause problem.
Type will always keep unchanged after new amount is added.
2015-09-22 21:07:31 +08:00
derekwaynecarr
ea919f6d1e Fix precision handling in validating LimitRange 2015-09-09 15:52:29 -04:00
derekwaynecarr
2e76842eb7 Update resource quota for requests 2015-09-03 14:24:59 -04:00
Jian Huang
c350d325e9 Solve Static Check Error 2015-08-19 13:38:56 +08:00
Janet Kuo
0ac6dba3f4 Make kubectl describe node include allocated resource 2015-08-10 13:25:59 -07:00
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
derekwaynecarr
6968a4e0df Improve quota describe output 2015-06-03 15:16:24 -04:00
Eric Paris
6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Joe Beda
bbb4479166 Convert controller-manager to hyperkube. 2015-02-02 10:01:36 -08:00
Joe Beda
dcd00c936e Move all kubernetes to posix flags 2015-01-15 09:12:19 -08:00
Daniel Smith
5767b41b28 make quantity flag work with pflag package 2015-01-14 15:16:53 -08:00
Daniel Smith
cc04db13d6 fix overeager find-and-replace 2015-01-07 16:38:27 -08:00
Daniel Smith
2050131b9a ParseOrDie -> MustParse; stop returning pointer 2015-01-07 15:21:35 -08:00
Daniel Smith
35f54addca Update more packages, tests, binaries for quantity
make etcd registry pass test
fix kubelet config for quantity
fix openstack for quantity
fix controller for quantity
fix last tests for quantity
wire into binaries
fix controller manager
fix build for 32 bit systems
2015-01-07 15:21:35 -08:00
Daniel Smith
cd58e49c78 remove 'i' and nasty rounding; test 2015-01-06 16:13:17 -08:00
Daniel Smith
2d2df5593c Add examples & clarify comments further 2015-01-06 15:18:22 -08:00
Daniel Smith
b7b2ee34de add flag helper func 2015-01-05 17:35:41 -08:00
Daniel Smith
6c6cdac0e9 Add accessor functions; round-trip test 2015-01-05 17:35:41 -08:00
Daniel Smith
18b896645c Saturation + test, also test negative numbers 2015-01-05 17:20:38 -08:00
Daniel Smith
394c9452e7 Start numeric type for resources 2015-01-05 17:20:38 -08:00