finding whether request is for post, and post id

something like this will work:

function record_hit_if_post(){
    global $wp_query;
    if($wp_query->is_single==1)
        // single post's ID:
        // $wp_query->post->ID;
}
add_filter('template_redirect', 'record_hit_if_post');