#
-# $Id: cf.data.pre,v 1.189 2000/06/25 22:41:21 wessels Exp $
+# $Id: cf.data.pre,v 1.190 2000/06/26 01:38:37 wessels Exp $
#
#
# SQUID Internet Object Cache http://squid.nlanr.net/Squid/
You can add up to 20 additional "extension" methods here.
DOC_END
+NAME: high_response_time_warning
+TYPE: int
+COMMENT: (msec)
+LOC: Config.warnings.high_rptm
+DEFAULT: 0
+DOC_START
+ If the one-minute median response time exceeds this value,
+ Squid prints a WARNING with debug level 0 to get the
+ administrators attention. The value is in milliseconds.
+DOC_END
+
+NAME: high_page_fault_warning
+TYPE: int
+LOC: Config.warnings.high_pf
+DEFAULT: 0
+DOC_START
+ If the one-minute average page fault rate exceeds this
+ value, Squid prints a WARNING with debug level 0 to get
+ the administrators attention. The value is in page faults
+ per second.
+DOC_END
+
+NAME: high_memory_warning
+TYPE: b_size_t
+LOC: Config.warnings.high_memory
+DEFAULT: 0
+DOC_START
+ If the memory usage (as determined by mallinfo) exceeds
+ value, Squid prints a WARNING with debug level 0 to get
+ the administrators attention.
+DOC_END
+
EOF
/*
- * $Id: stat.cc,v 1.328 2000/05/16 07:09:34 wessels Exp $
+ * $Id: stat.cc,v 1.329 2000/06/26 01:38:37 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
statCountersCopy(t, c);
NCountHourHist++;
}
+ if (Config.warnings.high_rptm > 0) {
+ int i = (int) statMedianSvc(1, MEDIAN_HTTP);
+ if (Config.warnings.high_rptm < i)
+ debug(18, 0) ("WARNING: Median response time is %d milliseconds\n", i);
+ }
+ if (Config.warnings.high_pf) {
+ int i = (CountHist[0].page_faults - CountHist[1].page_faults);
+ double dt = tvSubDsec(CountHist[0].timestamp, CountHist[1].timestamp);
+ if (i > 0 && dt > 0.0)
+ i /= (int) dt;
+ if (Config.warnings.high_pf < i)
+ debug(18, 0) ("WARNING: Page faults occuring at %d/sec\n", i);
+ }
+ if (Config.warnings.high_memory) {
+ int i = 0;
+#if HAVE_MSTATS && HAVE_GNUMALLOC_H
+ struct mstats ms = mstats();
+ i = ms.bytes_total;
+#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO
+ struct mallinfo mp = mallinfo();
+ i = mp.arena;
+#endif
+ if (Config.warnings.high_pf < i)
+ debug(18, 0) ("WARNING: Memory usage at %d MB\n", i >> 20);
+ }
}
static void
/*
- * $Id: structs.h,v 1.341 2000/06/25 22:41:22 wessels Exp $
+ * $Id: structs.h,v 1.342 2000/06/26 01:38:38 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
} digest;
#endif
wordlist *ext_methods;
+ struct {
+ int high_rptm;
+ int high_pf;
+ int high_memory;
+ } warnings;
};
struct _SquidConfig2 {