From 3b17a2054b40d870a0b44ae4bf8d2272a2f48175 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Thu, 12 Feb 2015 14:28:31 +0100 Subject: [PATCH] polygraph: new package Performance testing tool for caching proxies, origin server accelerators, L4/7 switches, content filters, and other Web intermediaries http://www.web-polygraph.org --- pkgs/tools/networking/polygraph/default.nix | 21 +++++ .../networking/polygraph/fix_build.patch | 77 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 100 insertions(+) create mode 100644 pkgs/tools/networking/polygraph/default.nix create mode 100644 pkgs/tools/networking/polygraph/fix_build.patch diff --git a/pkgs/tools/networking/polygraph/default.nix b/pkgs/tools/networking/polygraph/default.nix new file mode 100644 index 000000000000..09357e87da01 --- /dev/null +++ b/pkgs/tools/networking/polygraph/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl, openssl, zlib, ncurses }: + +stdenv.mkDerivation rec { + name = "polygraph-4.3.2"; + + src = fetchurl { + url = "http://www.web-polygraph.org/downloads/srcs/${name}-src.tgz"; + sha256 = "1fv9jpcicfsgsmghkykqif6l6w7nwvk5xbdmpv72jbrwzx44845h"; + }; + + buildInputs = [ openssl zlib ncurses ]; + + patches = [ ./fix_build.patch ]; + + meta = with stdenv.lib; { + homepage = http://www.web-polygraph.org; + description = "Performance testing tool for caching proxies, origin server accelerators, L4/7 switches, content filters, and other Web intermediaries"; + platforms = platforms.linux; + maintainers = [ maintainers.lethalman ]; + }; +} \ No newline at end of file diff --git a/pkgs/tools/networking/polygraph/fix_build.patch b/pkgs/tools/networking/polygraph/fix_build.patch new file mode 100644 index 000000000000..96832d72037a --- /dev/null +++ b/pkgs/tools/networking/polygraph/fix_build.patch @@ -0,0 +1,77 @@ +Description: Fix ftbfs with GCC-4.7. +Author: Mònica Ramírez Arceda +Bug-Debian: http://bugs.debian.org/667326 +Last-Update: 2012-05-11 + +--- a/src/xstd/Heap.h ++++ b/src/xstd/Heap.h +@@ -23,7 +23,7 @@ + const Item &top() const { return this->theItems[1]; } + Item &at(int idx) { return this->theItems[idx+1]; } + +- void add(Item v) { append(v); floatUp(++theCnt); } ++ void add(Item v) { this->append(v); floatUp(++theCnt); } + void skip() { this->theItems[1] = this->theItems[theCnt--]; this->theCount--; sinkDown(1); } + Item shift() { const Item v = this->theItems[1]; skip(); return v; } + +--- a/src/xstd/Ring.h ++++ b/src/xstd/Ring.h +@@ -22,11 +22,11 @@ + int size() const { return Array::size(); } + bool empty() const { return this->theInOff <= this->theOutOff; } + bool full() const { return count() >= this->theCapacity; } +- const Item &top(int off = 0) const { return item((this->theOutOff+off) % this->theCapacity); } ++ const Item &top(int off = 0) const { return this->item((this->theOutOff+off) % this->theCapacity); } + +- Item &top(int off = 0) { return item((this->theOutOff+off) % this->theCapacity); } +- void enqueue(Item i) { Assert(!full()); item(this->theInOff++ % this->theCapacity) = i; check(); } +- Item dequeue() { return item(this->theOutOff++ % this->theCapacity); } ++ Item &top(int off = 0) { return this->item((this->theOutOff+off) % this->theCapacity); } ++ void enqueue(Item i) { Assert(!full()); this->item(this->theInOff++ % this->theCapacity) = i; check(); } ++ Item dequeue() { return this->item(this->theOutOff++ % this->theCapacity); } + + void reset() { this->theInOff = this->theOutOff = 0; } + inline void resize(int aCap); +--- a/src/runtime/StatPhase.cc ++++ b/src/runtime/StatPhase.cc +@@ -413,12 +413,12 @@ + break; + } + } else { +- static CompoundXactInfo &compound = *CompoundXactInfo::Create(); +- compound.exchanges = 1; +- compound.reqSize = reqSize; +- compound.repSize = repSize; +- compound.lifeTime = repTime; +- compound.record(rec.theIsolated); ++ static CompoundXactInfo &compound2 = *CompoundXactInfo::Create(); ++ compound2.exchanges = 1; ++ compound2.reqSize = reqSize; ++ compound2.repSize = repSize; ++ compound2.lifeTime = repTime; ++ compound2.record(rec.theIsolated); + } + + if (x->cookiesSent() > 0) +--- a/src/cache/CacheEntryHash.cc ++++ b/src/cache/CacheEntryHash.cc +@@ -14,7 +14,7 @@ + + CacheEntryHash::CacheEntryHash(int aCapacity): theCount(0) { + theCapacity = (aCapacity + aCapacity/3 + 7) | 1; +- theIndex = new (CacheEntry*[theCapacity]); ++ theIndex = new (CacheEntry*[this->theCapacity]); + memset(theIndex, 0, sizeof(CacheEntry*)*theCapacity); + } + +--- a/src/tools/IntIntHash.cc ++++ b/src/tools/IntIntHash.cc +@@ -13,7 +13,7 @@ + + IntIntHash::IntIntHash(int aCapacity): theHashCap(0) { + theHashCap = (aCapacity + aCapacity/3 + 7) | 1; +- theIndex = new (IntIntHashItem*[theHashCap]); ++ theIndex = new (IntIntHashItem*[this->theHashCap]); + memset(theIndex, 0, sizeof(IntIntHashItem*)*theHashCap); + } + \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f9122313a166..bc94200c4087 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2327,6 +2327,8 @@ let pastebinit = callPackage ../tools/misc/pastebinit { }; + polygraph = callPackage ../tools/networking/polygraph { }; + psmisc = callPackage ../os-specific/linux/psmisc { }; pstoedit = callPackage ../tools/graphics/pstoedit { };