#include "SkBlurDrawLooper.h"
#include "SkBlurImageFilter.h"
#include "SkBlurMaskFilter.h"
+#include "SkBlurTypes.h"
#include "SkCanvas.h"
#include "SkChecksum.h"
#include "SkChunkAlloc.h"
#include "SkRefCnt.h"
#include "SkRegion.h"
#include "SkRRect.h"
-#include "SkRTreePicture.h"
#include "SkScalar.h"
#include "SkShader.h"
#include "SkSize.h"
#include "SkTemplates.h"
#include "SkTestImageFilters.h"
#include "SkThread.h"
-#include "SkTileGridPicture.h"
#include "SkTileImageFilter.h"
#include "SkTime.h"
#include "SkTInternalLList.h"
#include "SkTypes.h"
#include "SkUnPreMultiply.h"
#include "SkUtils.h"
+#include "SkVertState.h"
#include "SkWeakRefCnt.h"
#include "SkWriteBuffer.h"
#include "SkWriter32.h"
"io/ioutil"
"log"
"math/rand"
+ "net"
"net/http"
"os"
"os/exec"
"github.com/fiorix/go-web/autogzip"
_ "github.com/go-sql-driver/mysql"
_ "github.com/mattn/go-sqlite3"
+ "github.com/rcrowley/go-metrics"
)
const (
RESULT_COMPILE = `../../experimental/webtry/safec++ -DSK_GAMMA_SRGB -DSK_GAMMA_APPLY_TO_A8 -DSK_SCALAR_TO_FLOAT_EXCLUDED -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 -DSK_SUPPORT_GPU=0 -DSK_SUPPORT_OPENCL=0 -DSK_FORCE_DISTANCEFIELD_FONTS=0 -DSK_SCALAR_IS_FLOAT -DSK_CAN_USE_FLOAT -DSK_SAMPLES_FOR_X -DSK_BUILD_FOR_UNIX -DSK_USE_POSIX_THREADS -DSK_SYSTEM_ZLIB=1 -DSK_DEBUG -DSK_DEVELOPER=1 -I../../src/core -I../../src/images -I../../tools/flags -I../../include/config -I../../include/core -I../../include/pathops -I../../include/pipe -I../../include/effects -I../../include/ports -I../../src/sfnt -I../../include/utils -I../../src/utils -I../../include/images -g -fno-exceptions -fstrict-aliasing -Wall -Wextra -Winit-self -Wpointer-arith -Wno-unused-parameter -m64 -fno-rtti -Wnon-virtual-dtor -c ../../../cache/%s.cpp -o ../../../cache/%s.o`
- LINK = `../../experimental/webtry/safec++ -m64 -lstdc++ -lm -o ../../../inout/%s -Wl,--start-group ../../../cache/%s.o obj/experimental/webtry/webtry.main.o obj/gyp/libflags.a libskia_images.a libskia_core.a libskia_effects.a obj/gyp/libjpeg.a obj/gyp/libetc1.a obj/gyp/libwebp_dec.a obj/gyp/libwebp_demux.a obj/gyp/libwebp_dsp.a obj/gyp/libwebp_enc.a obj/gyp/libwebp_utils.a libskia_utils.a libskia_opts.a libskia_opts_ssse3.a libskia_ports.a libskia_sfnt.a -Wl,--end-group -lpng -lz -lgif -lpthread -lfontconfig -ldl -lfreetype`
+ LINK = `../../experimental/webtry/safec++ -m64 -lstdc++ -lm -o ../../../inout/%s -Wl,--start-group ../../../cache/%s.o obj/experimental/webtry/webtry.main.o obj/gyp/libflags.a libskia_images.a libskia_core.a libskia_effects.a obj/gyp/libjpeg.a obj/gyp/libetc1.a obj/gyp/libSkKTX.a obj/gyp/libwebp_dec.a obj/gyp/libwebp_demux.a obj/gyp/libwebp_dsp.a obj/gyp/libwebp_enc.a obj/gyp/libwebp_utils.a libskia_utils.a libskia_opts.a libskia_opts_ssse3.a libskia_ports.a libskia_sfnt.a -Wl,--end-group -lpng -lz -lgif -lpthread -lfontconfig -ldl -lfreetype`
DEFAULT_SAMPLE = `void draw(SkCanvas* canvas) {
SkPaint p;
gitHash = ""
gitInfo = ""
+
+ requestsCounter = metrics.NewRegisteredCounter("requests", metrics.DefaultRegistry)
)
// flags
}
}()
+ metrics.RegisterRuntimeMemStats(metrics.DefaultRegistry)
+ go metrics.CaptureRuntimeMemStats(metrics.DefaultRegistry, 1*time.Minute)
+
+ // Start reporting metrics.
+ // TODO(jcgregorio) We need a centrialized config server for storing things
+ // like the IP address of the Graphite monitor.
+ addr, _ := net.ResolveTCPAddr("tcp", "10.240.159.195:2003")
+ go metrics.Graphite(metrics.DefaultRegistry, 1*time.Minute, "webtry", addr)
+
writeOutAllSourceImages()
}
// mainHandler handles the GET and POST of the main page.
func mainHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("Main Handler: %q\n", r.URL.Path)
+ requestsCounter.Inc(1)
if r.Method == "GET" {
code := DEFAULT_SAMPLE
source := 0