Commit Graph

82 Commits

Author SHA1 Message Date
Brian Warner
daecca6589 big introducer refactoring: separate publish+subscribe. Addresses #271. 2008-02-05 13:05:13 -07:00
Brian Warner
769446b667 client.py: hush pyflakes 2008-02-01 20:28:15 -07:00
Brian Warner
054f25581c client.py: touch BASEDIR/no_storage to not publish a storage server. Addresses #271 2008-02-01 20:07:08 -07:00
robk-tahoe
e5487bbe21 stats: added IStatsProducer interface, fixed stats provider startup
this adds an interface, IStatsProducer, defining the get_stats() method
which the stats provider calls upon and registered producer, and made the
register_producer() method check that interface is implemented.

also refine the startup logic, so that the stats provider doesn't try and
connect out to the stats gatherer until after the node declares the tub
'ready'.  this is to address an issue whereby providers would attach to
the gatherer without providing a valid furl, and hence the gatherer would
be unable to determine the tubid of the connected client, leading to lost
samples.
2008-01-31 21:10:15 -07:00
robk-tahoe
7b9f3207d0 stats: add a simple stats gathering system
We have a desire to collect runtime statistics from multiple nodes primarily
for server monitoring purposes.   This implements a simple implementation of
such a system, as a skeleton to build more sophistication upon.

Each client now looks for a 'stats_gatherer.furl' config file.  If it has
been configured to use a stats gatherer, then it instantiates internally
a StatsProvider.  This is a central place for code which wishes to offer
stats up for monitoring to report them to, either by calling 
stats_provider.count('stat.name', value) to increment a counter, or by
registering a class as a stats producer with sp.register_producer(obj).

The StatsProvider connects to the StatsGatherer server and provides its
provider upon startup.  The StatsGatherer is then responsible for polling
the attached providers periodically to retrieve the data provided.
The provider queries each registered producer when the gatherer queries
the provider.  Both the internal 'counters' and the queried 'stats' are
then reported to the gatherer.

This provides a simple gatherer app, (c.f. make stats-gatherer-run)
which prints its furl and listens for incoming connections.  Once a
minute, the gatherer polls all connected providers, and writes the
retrieved data into a pickle file.

Also included is a munin plugin which knows how to read the gatherer's
stats.pickle and output data munin can interpret.  this plugin, 
tahoe-stats.py can be symlinked as multiple different names within
munin's 'plugins' directory, and inspects argv to determine which
data to display, doing a lookup in a table within that file.
It looks in the environment for 'statsfile' to determine the path to
the gatherer's stats.pickle.  An example plugins-conf.d file is
provided.
2008-01-30 20:11:07 -07:00
Brian Warner
51321944f0 megapatch: overhaul encoding_parameters handling: now it comes from the Uploadable, or the Client. Removed options= too. Also move helper towards resumability. 2008-01-16 03:03:35 -07:00
Brian Warner
e65967da49 upload: pass options through to the encoder 2008-01-14 21:17:32 -07:00
Brian Warner
7ac2b94aba remove wait_for_numpeers and the when_enough_peers call in mutable.Publish 2008-01-14 14:55:59 -07:00
Brian Warner
964edadf44 offloaded: add a system test, make it pass. files are now being uploaded through the helper. 2008-01-11 05:42:55 -07:00
Brian Warner
2ad84eeed8 offloaded: create a Helper if 'run_helper' is non-empty 2008-01-09 20:25:05 -07:00
Brian Warner
db71bdae9c offloaded: early code: most of client-side, defined the RemoteInterfaces 2008-01-08 21:18:54 -07:00
robk-tahoe
08c3ee73a2 reinstate creation of node.url files upon startup
a recent purge of the start.html code also took away the logic that wrote
'node.url' into the node root.  this is required for the tahoe cli tool to 
find the node.  this puts back a limited fraction of that code, so that the
node writes out a node.url file upon startup.
2008-01-07 18:04:56 -07:00
Zooko O'Whielacronx
5995d11a3c remove automatic private dir
* rename my_private_dir.cap to root_dir.cap
 * move it into the private subdir
 * change the cmdline argument "--root-uri=[private]" to "--dir-uri=[root]"
2008-01-03 17:02:05 -07:00
Zooko O'Whielacronx
eb373c0001 add human-encodings of caps, refactor encodings of caps, tighten checks, fix unit tests to use values of the right size 2008-01-03 16:55:43 -07:00
Brian Warner
b8d77fbb46 move my_private_dir.cap into private/ 2007-12-17 20:57:40 -07:00
Brian Warner
a592551ccf my_private_dir.cap: add newline for readability, open with mode 'w' not 'w+' since we don't need to read from this filehandle 2007-12-17 20:48:48 -07:00
Zooko O'Whielacronx
a983f6d60c rename "my_private_dir.uri" to "my_private_dir.cap" 2007-12-17 18:35:25 -07:00
Zooko O'Whielacronx
08a64c3a2b rename "secret" to "lease_secret" and change its size from 16 to 32 bytes 2007-12-17 18:34:11 -07:00
Zooko O'Whielacronx
8c65bdcf9d put all private state in $BASEDIR/private
fixes #219

The only part of #219 that this doesn't include is the part about 
logpublisher, which has been moved out of tahoe into foolscap.
2007-12-17 16:39:54 -07:00
Brian Warner
0dc84963f1 the wait_for_numpeers= argument to client.upload() is optional: make both the code and the Interface reflect this 2007-12-06 18:36:58 -07:00
Brian Warner
cca166a4f5 rename dirnode2.py to dirnode.py 2007-12-04 11:45:20 -07:00
Brian Warner
955bd5383d remove PyCrypto, now we only use pycrypto++ 2007-12-03 18:10:01 -07:00
Brian Warner
87e6ccbd4a remove leftover defer.setDebugging(), to speed up tests from 200s to 83s 2007-12-03 17:10:02 -07:00
Zooko O'Whielacronx
3605354a95 fix several bugs and warnings -- thanks, pyflakes 2007-12-03 15:42:35 -07:00
Zooko O'Whielacronx
59d6c3c822 decentralized directories: integration and testing
* use new decentralized directories everywhere instead of old centralized directories
 * provide UI to them through the web server
 * provide UI to them through the CLI
 * update unit tests to simulate decentralized mutable directories in order to test other components that rely on them
 * remove the notion of a "vdrive server" and a client thereof
 * remove the notion of a "public vdrive", which was a directory that was centrally published/subscribed automatically by the tahoe node (you can accomplish this manually by making a directory and posting the URL to it on your web site, for example)
 * add a notion of "wait_for_numpeers" when you need to publish data to peers, which is how many peers should be attached before you start.  The default is 1.
 * add __repr__ for filesystem nodes (note: these reprs contain a few bits of the secret key!)
 * fix a few bugs where we used to equate "mutable" with "not read-only".  Nowadays all directories are mutable, but some might be read-only (to you).
 * fix a few bugs where code wasn't aware of the new general-purpose metadata dict the comes with each filesystem edge
 * sundry fixes to unit tests to adjust to the new directories, e.g. don't assume that every share on disk belongs to a chk file.
2007-12-03 14:52:42 -07:00
Brian Warner
63233ecf37 consolidate dirnode/filenode-creation code into Client 2007-11-09 02:54:51 -07:00
Brian Warner
d772ea850d mutable: split dirnode stuff out to dirnode2.py, will be renamed later 2007-11-01 23:46:47 -07:00
Brian Warner
97f4d8c524 Client.tub_ready: upcall to Node 2007-11-01 17:27:12 -07:00
Brian Warner
1d8a4cdfe7 mutable: first pass at dirnodes, filenodes, new URIs. Some test coverage.
The URI typenames need revision, and only a few dirnode methods are
implemented. Filenodes are non-functional, but URI/key-management is in
place. There are a lot of classes with names like "NewDirectoryNode" that
will need to be rename once we decide what (if any) backwards compatibility
want to retain.
2007-11-01 15:15:29 -07:00
Brian Warner
9da1d70676 add a simple checker, for both files and directories 2007-10-15 16:16:39 -07:00
Brian Warner
a29ab33379 webish: write node.url, for the benefit of CLI tools 2007-10-11 01:38:04 -07:00
Brian Warner
c10da1e1ef client.py: add the missing remote_get_nodeid() method claimed in interfaces.py 2007-09-26 12:20:48 -07:00
Brian Warner
e05311f69a client.py: increase hotline timeout, the check_memory test is failing 2007-09-25 19:22:33 -07:00
Brian Warner
3774ce59ea check_memory: fix race condition for startup of in-process server nodes 2007-09-20 15:33:58 -07:00
Brian Warner
2b93164a03 test_runner: try harder to work on slow buildslaves and cygwin 2007-09-19 13:56:00 -07:00
Brian Warner
77394da447 client.py: only import webish.py if 'webport' is set, to save 3MB of footprint 2007-09-04 16:33:06 -07:00
Brian Warner
850bc9da02 deletion phase2b: create renew/cancel secrets for real. 2007-08-27 19:30:26 -07:00
Brian Warner
89ceb49309 node.py: change get_or_create_config() to accept a function 2007-08-27 19:07:12 -07:00
Brian Warner
56afda11d1 deletion phase2a: improve creation of renew/cancel secrets. Still fake though. 2007-08-27 19:00:18 -07:00
Brian Warner
77a7232867 node.py: refactor config-file getting and setting 2007-08-27 18:58:39 -07:00
tahoe
f49194cb5e trying to introduce old style humanreadablied logs hopefully without breaking the existing ones 2007-08-11 14:52:37 -07:00
Brian Warner
4de5767c98 web: remove /vdrive/private, replace with a start.html file that points at the /uri/PRIVATE_URI, to prevent XSRF attacks 2007-08-22 14:54:34 -07:00
Zooko O'Whielacronx
8717905e35 refactor reading of configuration files in client.py
This makes it so that an optional file which is unreadable or is rm'ed 
at the wrong moment will be ignored instead of raising an exception.   
It also bums out a couple of unnecessary lines of code (the explicit  
".close()" call).
2007-08-22 10:29:57 -07:00
Brian Warner
d5262ec7e1 client.py: add a newline to "myself.furl" contents 2007-08-17 23:28:22 -07:00
Brian Warner
a0c16f1a36 client.py: make a note in the logs when the auto-shutdown feature is in use 2007-08-14 02:12:30 -07:00
Brian Warner
6c6c62037d fix pyflakes warnings from recent b32decode change 2007-08-12 16:33:51 -07:00
Brian Warner
1ac83637a6 Client.get_permuted_peers: use self.nodeid now that it's fixed 2007-08-12 16:24:51 -07:00
Brian Warner
2f5a27316f webish: localfile=/localdir= are now disabled by default, a special switch is required to enable them 2007-08-10 18:21:22 -07:00
Brian Warner
998802fd6d #96: add flag to enable pushing data to ourselves, defaulting to False 2007-08-09 18:30:24 -07:00
Brian Warner
0826b1bd34 introducer.py: minor rearrangement of methods 2007-07-16 19:47:42 -07:00