<commit_before>/*
 * Copyright IBM Corporation 2016
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/// A protocol for implementing a delegate to receive monitoring events from KituraNet.
public protocol ServerMonitor {
    /// An event fired when a HTTP request has finished being parsed and is about
    /// to be passed to the `ServerDelegate` for processing.
    ///
    /// - Parameter request: The `ServerRequest` class instance for the request starting.
    /// - Parameter response: The `ServerResponse` class instance for the request starting.
    func started(request: ServerRequest, response: ServerResponse)
    
    /// An event fired when th processing of a HTTP request has finished.
    ///
    /// - Parameter request: The `ServerRequest` class instance for the request that finished.
    /// - Parameter response: The `ServerResponse` class instance for the request  that finished.
    func finished(request: ServerRequest?, response: ServerResponse)
}

/// A struct that holds the reference to the server wide monitoring delegate.<commit_msg>IBM-Swift/Kitura#840 Fixed API documentation<commit_after>/*
 * Copyright IBM Corporation 2016
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/// A protocol for implementing a delegate to receive monitoring events from KituraNet.
public protocol ServerMonitor {
    /// An event fired when a HTTP request has finished being parsed and is about
    /// to be passed to the `ServerDelegate` for processing.
    ///
    /// - Parameter request: The `ServerRequest` class instance for the request starting.
    /// - Parameter response: The `ServerResponse` class instance for the request starting.
    func started(request: ServerRequest, response: ServerResponse)
    
    /// An event fired when the processing of a HTTP request has finished.
    ///
    /// - Parameter request: The `ServerRequest` class instance for the request that finished.
    /// - Parameter response: The `ServerResponse` class instance for the request  that finished.
    func finished(request: ServerRequest?, response: ServerResponse)
}

/// A struct that holds the reference to the server wide monitoring delegate.
{'fraction_non_alphanumeric': 0.07394587791063562, 'fraction_numerical': 0.005978602894902455, 'mean_word_length': 3.4774647887323944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6429218', 'n_tokens_mistral': 735, 'n_tokens_neox': 717, 'n_words': 394}