A method of reducing corrosion in a crude unit by measuring at least one property of a predominantly liquid sample, the method comprising the steps of: adding at least one chemical reagent to the sample, the chemical reagent capable of inducing a measurable optical effect when added to the sample that is directly related to the property to be detected, measuring the optical effect, and deducing the value of the property by comparing the measured optical effect to pre-determined values associated with the property to be determined, wherein the relationship between the measured optical effect and the property to be determined is independent of the volume of the liquid sample and independent of the volume of the reagent added to the sample; wherein the sample is positioned within an apparatus comprising at least one reagent source constructed and arranged to feed the reagent into a chamber where it is mixed with the sample and the sample is moved past an optical sensor that measures the optical property; the apparatus further comprises a Boron Doped Diamond cell through which the sample passes before the reagents are added, the Boron Doped Diamond cell being constructed and arranged to oxidize sulfoxy compounds, wherein the optical effect is measured: as the ratio of absorbance or fluorescence at a wavelength affected by the property to an absorbance or fluorescence at a wavelength unaffected by the property, or by determining an absorbance level at a particular wavelength whose measurement is recognized as an isosbestic point for all values of the property, detecting at least one other absorbance level for one other wavelength, ratioing the absorbance at a particular wavelength and the absorbance at the other wavelength, comparing the ratio with pre-determined data, and correlating the ratio to the known absorbance levels of a particular value of the property, or by the reagents being at least two fluorescent dyes, one of the dyes' fluorescence at a first wavelength is affected by the value of the property and one of the other dyes' fluorescence at a second wavelength is unaffected by the value of the property, the method further comprising the steps of measuring the ratio of the fluorescence intensity of the first and second wavelengths in the sample, comparing that ratio to the ratio of the fluorescence of the first and second wavelengths in a control having a known value of that property, and correlating the proportional change in the two ratios to the property value, or by the reagent's absorbance and fluorescence where the absorbance is unaffected by the value of the property and the fluorescence is affected by the value of the property, by comparing the ratio of the fluorescence to absorbance to a control having a known value of the property, and correlating the proportional change in the two ratios to the property. adding at least one chemical reagent to the sample, the chemical reagent capable of inducing a measurable optical effect when added to the sample that is directly related to the property to be detected, measuring the optical effect, and deducing the value of the property by comparing the measured optical effect to pre-determined values associated with the property to be determined, wherein the relationship between the measured optical effect and the property to be determined is independent of the volume of the liquid sample and independent of the volume of the reagent added to the sample; wherein the sample is positioned within an apparatus comprising at least one reagent source constructed and arranged to feed the reagent into a chamber where it is mixed with the sample and the sample is moved past an optical sensor that measures the optical property; the apparatus further comprises a Boron Doped Diamond cell through which the sample passes before the reagents are added, the Boron Doped Diamond cell being constructed and arranged to oxidize sulfoxy compounds, as the ratio of absorbance or fluorescence at a wavelength affected by the property to an absorbance or fluorescence at a wavelength unaffected by the property, or by determining an absorbance level at a particular wavelength whose measurement is recognized as an isosbestic point for all values of the property, detecting at least one other absorbance level for one other wavelength, ratioing the absorbance at a particular wavelength and the absorbance at the other wavelength, comparing the ratio with pre-determined data, and correlating the ratio to the known absorbance levels of a particular value of the property, or by the reagents being at least two fluorescent dyes, one of the dyes' fluorescence at a first wavelength is affected by the value of the property and one of the other dyes' fluorescence at a second wavelength is unaffected by the value of the property, the method further comprising the steps of measuring the ratio of the fluorescence intensity of the first and second wavelengths in the sample, comparing that ratio to the ratio of the fluorescence of the first and second wavelengths in a control having a known value of that property, and correlating the proportional change in the two ratios to the property value, or by the reagent's absorbance and fluorescence where the absorbance is unaffected by the value of the property and the fluorescence is affected by the value of the property, by comparing the ratio of the fluorescence to absorbance to a control having a known value of the property, and correlating the proportional change in the two ratios to the property.