The invention provides, inter alia, automated medical methods and apparatus that test PD effluent in a flow path (e.g., with an APD system or CAPD setup) to detect, for example, the onset of peritonitis, based on optical characteristics of the effluent resolved at cellular scales of distance. For example, according to one aspect of the invention, an APD machine includes, in an effluent flow path, apparatus for early stage peritonitis detection comprising an illumination source and a detector. The source is arranged to illuminate peritoneal effluent in a chamber that forms part of the flow path, and the detector is arranged to detect illuminant scattered by the effluent. The detector detects that reflected or scattered illuminant at a cellular scale of resolution, e.g., on a scale such that separate cellular-sized biological (or other) components in the effluent can be distinguished from one another based on scattering events detected by the detector.